lua-users home
lua-l archive

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


> ( assuming, of course, that 2^31 falls within the range of integers
>  which can be represented exactly in the particular Lua implementation;
>  this is certainly the case in the original posting )

Nah it doesn't, 31 bits for value + 1 bit for sign, makes 2^31-1 a maximum value you can represent with 32-bit integer. While the result you get -2147483648 is exactly 2^31 casted to 32-bit int, sign bit = 1, value bits all zero 0.
-- 
Adam Strzelecki