lua-users home
lua-l archive

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


On Mon, 26 Nov 2018 at 21:47, Philippe Verdy <verdyp@gmail.com> wrote:
>
> That is not true. Lua is designed to allow its number type to be configurable but in its default configuration it just uses what C gives as a double.
>
> Nothing indicates it can store any 64 bit integer and in fact it can almost never store them in a single number, unless Lua is specifically compiled using long double in C and they are represented as 80 bit with a 64 bit mantissa part...
>

Hi, above is incorrect. I know as I maintain Ravi a derivative of Lua
5.3. Integers are maintained natively as integer values in 5.3.
Conversion to double happens as per C promotion rules - when you do
operations that involve integer and double values. I am a bit
concerned that you may be stating things as if they are true when they
are not.

I would suggest you try out Lua 5.3 and look at its source code.

Regards
Dibyendu