lua-users home
lua-l archive

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


On 27/07/2011 23.10, Luiz Henrique de Figueiredo wrote:
     >  =big
     2500000000
     >  =string.format('%d', big)
     -2147483648

This works fine in 5.2:

Lua 5.2.0  Copyright (C) 1994-2011 Lua.org, PUC-Rio
big=2500000000
=string.format('%d', big)
2500000000



Strangely enough, it doesn't work for me and neither this one :

-- Lua 5.2.0 on Windows XP (SP2)
-- CPU: Intel Mobile Core 2 Duo T7500
-- Compiled with TDM-GCC 4.5.2
x = 2^31
print( ("%.0f     %d"):format(x,x) )
--> 2147483648     -2147483648

-- Lorenzo