in reply to Re: Answer: How do I round a number?
in thread How do I round a number?
So, I hadn't thought much about negative numbers. Is it mathematically correct for the ceiling function to go to the next more negative number (to the left on a number line) or to truncate (ie int) a negative number (move toward the right on a number line)?
I think the rounding functions for negative numbers are correct (don't need adjusting), you're simply moving toward the nearest whole number...
-Scott
Update: As further discussed below, the code did originally have issues, the code in the answer above has now been replaced by working code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Answer: How do I round a number?
by Roy Johnson (Monsignor) on Apr 27, 2005 at 18:32 UTC | |
by 5mi11er (Deacon) on Apr 27, 2005 at 18:46 UTC |