[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua minus null (-0)
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 9 Jun 2011 11:25:32 -0300
> Huh? Lua is _not_ C. The above definitions are _internals_ of Lua. C
> does not even _have_ a generic tostring function, so it is nonsensical
> to talk about "Lua behaves differently from C".
Just to focus the discussion, the point is not about Lua being or not
different from C, but about Lua being or not different from IEEE 754.
The IEEE 754 standard is quite respected. It was written by people that
understands much more than us (or at least than me) about the nuances
of number representations. If they decided that there should be a -0,
that 0 == -0 but 1/0 ~= 1/-0, and that -0 should print as -0, I see
no reason to disagree.
Seriously, I do not see what is the big problem. Those that know about
the realities of IEEE 754 already know about 0 x -0. Those that don't
should know (from basic math) that 0 == -0. (And integer types would
only make things worse from this point of view, as hardware-supported
integer representations have even stranger behavior.)
-- Roberto
- References:
- Re: Lua minus null (-0), Dirk Laurie
- Re: Lua minus null (-0), Henk Boom
- Re: Lua minus null (-0), Dirk Laurie
- Re: Lua minus null (-0), Everett L Williams II
- Re: Lua minus null (-0), Dirk Laurie
- Re: Lua minus null (-0), David Kastrup
- Re: Lua minus null (-0), Dirk Laurie
- Re: Lua minus null (-0), David Kastrup
- Re: Lua minus null (-0), Dirk Laurie
- Re: Lua minus null (-0), David Kastrup