[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.1 (work4) now available
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 31 Dec 2004 08:22:06 -0200
> 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