lua-users home
lua-l archive

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


I'm pretty sure Roberto understands -why- it's happening, it's just a question of whether:

assert(x == y) -- passes
assert(x+1 == y+1) -- fails

is acceptable. Because it is impossible to tell from within lua if x and y are different types internally or not, and in the case they are, they'll perform differently to if they're not. Could cause problems with scientific calculations - remember that the pentiums (in)famous FDIV bug would have never been a problem outside of these kind of applications.

Granted, it's a rare occurence. But it's a gotcha that would be, as far as I can tell, unique to Lua. And lets not forget that 64 bit arithmetic on x86 is hardly faster then floating point ops, meaning that this extra precision (which is only sometimes available) is the only gain from the patch.

Personally though I think the patch is essential processors without FPUs, or when using single precision floats (mantissa isn't wide enough), but I don't understand the need for it elsewhere... although that's probably just me.

- Alex