Wow, that's quite a scratchpad, thanks.
in reply to Re: Answer: How do I round a number?
in thread math
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...
As further discussed below, the code did originally have issues, the code in the answer above has now been replaced by working code.