Wow, that's quite a scratchpad, thanks.
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.
| [reply] |
| [reply] [d/l] |
Yes, the plain ceil function is fine, but the XL_ceil, and ceil_qtrs functions are (nearly certainly, without actually testing) broken for negative numbers. I'll have to play a bit later and see if I can fix those functions in a similar way...
Update: Indeed there were issues with that code. I have /msg'ed the QandAEditors, and asked them to replace the bad code, but until they do, I've placed the new code on my scratchpad.
-Scott
Update: Erroneous code has since been replaced with working code.
| [reply] |