lua-users home
lua-l archive

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


On 5 June 2011 07:31, Dirk Laurie <dpl@sun.ac.za> wrote:
> On Sun, Jun 05, 2011 at 12:47:39PM +0200, Sebastian wrote:
>> I have found an interesting bug. if you run
>>
>> a = 0
>> b = -0
>> if (a == b) then
>> print("0 is -0!")
>> end
>>
>> in the lua demo (http://www.lua.org/cgi-bin/demo), then you see that lua
>> does'nt make a difference between 0 and -0.
>
> This is not a Lua bug.  It is not any kind of bug.  It is defined this
> way in the IEEE 754 floating-point standard:

If I understand the Sebastian properly, he is not complaining that lua
doesn't differentiate between them, but that these two numbers which
are not normally differentiated do not print the same:

On Sun, Jun 05, 2011 at 12:47:39PM +0200, Sebastian wrote:
> The problem of the output from -0 is that -0 does'nt look good.
> The user (for example a wow addon user) can be disoriented,
> when he read the addon output: "(-20) * 0 = -0.