lua-users home
lua-l archive

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


> Why all the fuss over this rint function btw?  Will an int cast not do 
> fine?

A cast will do fine in all cases. However, C semantics requires specific
roundings to occur when you cast a double to int. The C compiler then has
to generate *several* instructions to ensure that. I think Roberto timed it
and it did make a difference. Hence the possibility in luaconf.h to do this
conversion without fussing about rounding modes.
--lhf