[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: tonumber() on negative hexadecimal strings
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 19 Apr 2011 13:10:29 -0300
> I searched for the following issue in the bug list, and it isn't there.
>
> lua
> Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> > =tonumber("-0x10")
> 4294967280
>
> Both Lua 5.2 and LuaJIT 2.0 give -16.
Lua 5.1 manual - http://www.lua.org/manual/5.1/manual.html#pdf-tonumber
In other [different from 10] bases, only unsigned integers are accepted.
-- Roberto