[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lua number type and 64-bit machines
- From: John Barham <jbarham@...>
- Date: Thu, 5 Mar 2009 21:49:29 -0800
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