in reply to Re^2: Answer: How do I round a number?
in thread How do I round a number?

ceil should always round toward the right on a number line, so your ceil is correct. In fact, it's the same thing I came up with in Re^2: Perl oddities. Note merlyn's response, though.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^4: Answer: How do I round a number?
by 5mi11er (Deacon) on Apr 27, 2005 at 18:46 UTC
    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.