lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tuesday 23 August 2005 22:40, Shmuel Zeigerman wrote:
[...]
>      math.floor(num+0.5)

That doesn't get the even-odd rounding rules correct, which are (IIRC) 
mandatory for any financial work. (Of course, you're insane if you're using 
floats for financial work anyway.) It'll always round 0.5, 1.5 etc up.

Adam Moss wrote:
> Neither function is part of ANSI C (C89), I believe.

However, they are in C99...

-- 
"Curses! Foiled by the chilled dairy treats of righteousness!" --- Earthworm 
Jim (evil)

Attachment: pgpA1SqDVHzMo.pgp
Description: PGP signature