[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua number type and 64-bit machines
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Fri, 6 Mar 2009 14:57:31 +0100
Lua uses doubles on 32bit machines, shouldn't 64bit machines use long
doubles or even quadruple precision floats ?
2009/3/6 John Barham <jbarham@gmail.com>:
> Hi all, Lua newbie (but long-time C and Python programmer) here, and
> apologies if this issue has already been resolved.
>
> Given the following:
>
> 1. Lua's number type is conventionally a typedef for 64-bit double
> precision floating-point numbers
> 2. 64-bit floats can only represent integers up to 53 bits of precision
> 3. 64-bit machines are becoming increasingly popular
>
> is there a case for adding a separate integer numeric type to Lua? Or
> would it be feasible to emulate Python's arbitrary precision "long"
> integer type that is automatically created on overflow?
>
> I appreciate that currently having only one numeric type helps keep
> Lua simple, but I fear that on 64-bit machines Lua's number type might
> not be able to represent common integer values such as process ids or
> file offsets.
>
> John
>