lua-users home
lua-l archive

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


> Finally, you can write those in Lua:
>
>  function isnan(x) return x~=x end
>  function isinfinity(x) return x+1==x end

Your isinfinity() won't work once you run out of mantissa bits (at around
1e16 in IEEE doubles), where 1e16+1=1e16.

Jay