lua-users home
lua-l archive

RE: integer math

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


>From: aircooledspeed [mailto:cpercival@interaxis.co.uk]
>My app will need quite a lot of integer math and I am worried about 
>rounding errors. Its it posable to change LUA_NUM_TYPE to int? Any 
>problems with that?
It shouldn't be necessary. Integer values (up to some very large limit -
much greater than int) are exactly representable in the format used by
double, so there will be no errors. You just have to remember to explicitly
round after every division.
-Virus scanned and cleared ok

AltStyle によって変換されたページ (->オリジナル) /