[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: tostring and 0
- From: Tony Finch <dot@...>
- Date: Fri, 27 Apr 2012 11:21:11 +0100
Valeriy Skurikhin <keen.vs@gmail.com> wrote:
>
> Recently I found, that results of tostring(0) and tostring(-0) may
> depend on call order.
Actually what you are observing is the way Lua stores literal constants.
Since +0 and -0 compare equal, only one of them is retained when the
script is compiled.
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
West Bailey: Northerly 4 or 5, becoming variable 3 or 4, then southwesterly 4
or 5, occasionally 6 later. Rough becoming moderate. Fair. Good.