Is it possible to create an int64 value rather than double and is it possible to directly get and set the IntValue to 2 ^ 53 + 1 on Roblox Lua?

IntValues stores the value as a 64-bit integer. Lua 5.1 however stores number as double, and it gets converted to double when getting these IntValues.
Without IntValues, is it possible to create a 64-bit integer on Roblox Lua (I know IntValue did it)?

and is it possible to directly get and set the IntValue via scripts without the 2 ^ 53 limitation of a double value, so that IntValue will be setted as 9007199254740993 and not 9007199254740992?
IntValue.Value = '9007199254740993' doesn’t work as it gets converted to double then to int64.

and why does the IntValue exist when all numbers in Lua 5.1 are double?

Just for my curiousity is it possible to do both of these?

1 Like

Are you thinking of NumberValues?

They behave exactly as IntValues, but you can store doubles instead of integers.

I know there’s NumberValue. But what I’m asking is

  1. Can you directly set the IntValue to numbers like 9007199254740993?
  2. Can you directly get the IntValue without being it converted to double?
  3. Can you create a 64-bit integer without IntValues?

Late response, but I am sure it will be helpful to people in future.

If you mean is there any other way than using IntValue, no there isn’t. Lua 5.1 Numbers are 64 - bit doubles. It’s how Lua works!

Can’t do anything about it, that’s how Lua works.

I am not sure, but I hope Roblox would do Integer Arithmetic when dealing with IntValues. You should probably test this yourself.

IntValue.Value *= 2 -- hopefully, it does integer multiplication, not floating-point