lua-users home
lua-l archive

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


> I don't see why you're suddenly worried, as nothing has changed - Lua
> in its default state has never supported 64 bit integers, as with
> lua_Number == double, you only get 52 bit integers. Given that bit
> operations on 52 bits are rarely wanted, it makes sense for the bit
> manipulation library to treat integers as 32 bit integers, as that is
> the largest value <= 52 which is commonly wanted.

Has anyone already tried to compile Lua with lua_Number defined as the
"long double" C data type, which maps (on GCC for x86) to a 80 bits
floating type?
This larger format has 64 bits mantissa, so allowing a 64 bits integer
to be stored without loss.
But the cost would be an increase of memory usage, and the lack of
portability. Microsoft compiler for example consider "long double" to
be the same size than a "double".