64-bit data types in Lua
planned
Huns Valen
There was a ticket elsewhere about supporting 64-bit unixtime by returning a list of the two halves of a 64-bit int, 32 bits wide. (32-bit ints run out for that purpose in about ten years.) There are probably other reasons you'd want to store a 64-bit int or float, like astronomical calculations.
Is this going to be possible in Lua, or in LSL after the Lua cutover, without scripters writing a BCD layer or some other Rube Goldberg solution?
Log In
H
Harold Linden
marked this post as
planned
Tapple Gao
There's some upstream effort on adding 64-bit integers to luau: https://github.com/luau-lang/rfcs/pull/182
H
Harold Linden
Tapple Gao Yep, we'll probably pull this in shortly after they do. In the meantime, simulating int64 arithmetic via
double
+ hi/lo
pairs is the conventional way of doing this in Luas without int64
Logan Elf
SLua "Number" is a 64 bit float (IEEE-754 binary64) already. Luau (which is what SLua is based on) doesn't have 64bit integers unfortunately.
Huns Valen
Logan Elf
I guess an f64 is better than nothing!