lua-users home
lua-l archive

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


>Is this a bug in lua or in my C compiler (Gnu C)?
>Try
>   x = tonumber("FFFFFFFF",16)
>   print(x+1)
>   write(format("%d\n",x+1))
> What does yours do? 

My Linux gives

4294967296
-2147483648

This seems correct, except that conversion from double to int does not work
well when the double value is too large (ie does not fit into an int).
--lhf