lua-users home
lua-l archive

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


> Anyway, I seem to remember that some printing problem producing -0 for
> no apparent reason had been fixed in some Lua version in the past.
> Maybe it is an older version for which this result appears.

The problem is that Lua unifies 0 and -0 in the constant table:

  x=-0; y=0; print(x,y)   -->   -0   -0
  x=0;  y=-0; print(x,y)  -->    0    0

This problem affects only code that has literal or "constant-folded"
negative zeros. (It has not been fixed...)

-- Roberto