lua-users home
lua-l archive

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


> Have you configured Lua to use integer math? I seem to remember there 
> was a flaw in Lua 5 that stopped random numbers from working properly 
> with integer types, and I've not checked to see if it was fixed in 5.1.

Almost the whole math library does not make sense if lua_Number is int.
The only exceptions are abs, max, min, random (with args), randomseed.
For integer math, other functions such as idiv (quotient+remainder),
gcd, ipow, and support for modular arithmetic are probably what is needed.
I think they should go into a separate library.
--lhf