12-26-2004, 07:08 AM
Sterling,
I appreciate your efforts in correcting my algorithms, but THEY WERE NEVER INTENDED TO DO ROUNDING.
Please notice that the definition of each algorithm says COMPUTE THE NEAREST MULTIPLE and COMPUTE THE NEXT MULTIPLE.
Athough it's not readily apparent, I never intended the input number to be negative or to have decimal places. To consider these, they would no longer be one line algorithms.
So, based on all of this:
* My NEXT solution will always move UP to the next multiple.
* My NEAREST solution will either move UP or stay where it is.
Neither will ever ROUND DOWN. That's not what this is about. In Zha's original post he did use the word "round", although his example was not about rounding, but moving or positioning to the next multiple of 5.
The bit about CINT, yeah it's funny. It's almost as funny as the results you get when testing positive and negative numbers where the decimal part is ".5".
*****
I appreciate your efforts in correcting my algorithms, but THEY WERE NEVER INTENDED TO DO ROUNDING.
Please notice that the definition of each algorithm says COMPUTE THE NEAREST MULTIPLE and COMPUTE THE NEXT MULTIPLE.
Athough it's not readily apparent, I never intended the input number to be negative or to have decimal places. To consider these, they would no longer be one line algorithms.
So, based on all of this:
* My NEXT solution will always move UP to the next multiple.
* My NEAREST solution will either move UP or stay where it is.
Neither will ever ROUND DOWN. That's not what this is about. In Zha's original post he did use the word "round", although his example was not about rounding, but moving or positioning to the next multiple of 5.
The bit about CINT, yeah it's funny. It's almost as funny as the results you get when testing positive and negative numbers where the decimal part is ".5".
*****