[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is this a bug?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sun, 4 Feb 2001 22:15:05 -0200
>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