lua-users home
lua-l archive

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


> >I've been using Lua on QNX RtP lately, and this morning I noticed
something strange: the number 65 is always displayed as 64.999999...
>
[...]
> >Maybe the function that converts a number to a string?
>
> Lua uses sprintf for this. Perhaps sprintf is broken in QNX.

Sounds like normal floating point inaccuracies when trying the entire
fractional part of a number.  This happens on every platform.  If you
restrict the precision to two or three when displaying the number, then you
will get 65.00 or 65.000.

Steve 'Sly' Williams - Code Monkey - http://www.kromestudios.com