lua-users home
lua-l archive

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



On 22-Jan-06, at 7:32 PM, D Burgess wrote:

On 1/23/06, Rici Lake <lua@ricilake.net> wrote:

In any event, if you compile lua (or at least lvm.c) with the option
-mno-fused-madd, then you'll get 0 rather -0. (Or you could redefine
luai_nummod in terms of fmod and copysign.)


Hi Rici,

It seems to me that this is important enough that it should be in
the lua manual.

Or fixed :) It's not the only problem with %:

> for i = 50, 70 do io.write(2^i % 3, " ") end; io.write"\n"
1 2 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> for i = 50, 70 do io.write(math.fmod(2^i, 3), " ") end; io.write"\n"
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1