lua-users home
lua-l archive

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


On Tue, Jul 26, 2011 at 11:06:38PM +0200, Doug Currie wrote:
 
> This also shows that tonumber (in Lua 5.1.4) has trouble with negative number strings not in base 10.
> 
> > return tonumber('-3ZM2P', 36)
> 1.8446744073703e+19
> 
> > return tonumber('-3456', 10)
> -3456
> 
> > return tonumber('-1010', 2)
> 1.844674407371e+19
> 
> e
> 
> 

Seems to be cleared up already.

Lua 5.2.0 (beta)  Copyright (C) 1994-2011 Lua.org, PUC-Rio
> return tonumber('3ZM2P', 36)
6700417
> return tonumber('-3ZM2P', 36)
-6700417
> return tonumber('-1010', 2)
-10

Dirk