[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: tostring and 0
- From: Valeriy Skurikhin <keen.vs@...>
- Date: Fri, 27 Apr 2012 16:57:42 +0700
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