lua-users home
lua-l archive

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


On Sun, Jul 31, 2016 at 1:30 AM, Duane Leslie <[email protected]> wrote:
> > rint(0.50001)
> 0

I get 1 as the result on my version, not sure how you could get otherwise.  The addition should populate the guard and sticky bits which should then round up.

This behavior seems to be system-dependent.
On my home computer I get 1 on Windows and 0 on Linux.
You can see also
http://codepad.org/XmWHCBXg
(this is Lua 5.1, but FPU rounding logic should not depend on Lua version)