lua-users home
lua-l archive

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


Hi, list!

Recently I found, that results of tostring(0) and tostring(-0) may
depend on call order.

Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> return (tostring(0) .. tostring(-0))
00
> return (tostring(-0) .. tostring(0))
-0-0

A bit confusing behaviour. And it was chnanged in Lua 5.2:

Lua 5.2.0  Copyright (C) 1994-2011 Lua.org, PUC-Rio
> return (tostring(0) .. tostring(-0))
0-0
> return (tostring(-0) .. tostring(0))
-00

I believe this feature is known to the community, but I didn't manage
to find any clear anwser, whether it should be considered as a bug or
not. Could someone give me any reference, please?

Regards,
Valeiry