lua-users home
lua-l archive

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


On Tuesday, March 25, 2008 Mark Hamburg wrote: 

> on 3/25/08 1:50 PM, Asko Kauppi at askok@dnainternet.net wrote:

>> 
>> Mark Hamburg kirjoitti 25.3.2008 kello 18:36:
>>> The patch should kick out of the integer realm at the boundary of
>>> floating-point precision not at the boundary of integer precision.
>>> Thus,
>>> calculating 2 ^ 63 should result in the value being stored as a
>>> double even
>>> though it could fit into a 64-bit integer.
>> 
>> But this is exactly what it does. The "integer realm" is signed
>> integers, -2^63 .. +2^63-1 with int64 mode. 2^63 does not fit into a
>> signed 64-bit integer.

> Sorry. I wrote too fast. My point was that even 2 ^ 63 - 1 should be stored
> as a double.

Yes, storing any number outside the range -2 ^ 53 to 2 ^ 53 as a 
double would avoid the problem.

e

-- 
Doug Currie
Londonderry, NH, USA