How big is math.huge?
I didn’t find any documents on it at all
I know it’s INF but I want a number
I also need to know what the number limit is before the value goes crazy (like going negative) because it’s too big
How big is math.huge?
I didn’t find any documents on it at all
I know it’s INF but I want a number
I also need to know what the number limit is before the value goes crazy (like going negative) because it’s too big
I don’t understand the question…? math.huge
is infinite , there isn’t a numerical equivalent.
“math.huge is any number greater than or equal to 2 to the power of 1024 minus 1, which can be represented in Lua by math.huge >= 2^1024 - 1”
what about the number before reaching math.huge?
like let’s say 11 is math.huge and 10 is before hitting math.huge?
and thank you @RedDuck765 I’ll give it a read!
The number before reaching math.huge = 2^1023.999999999…
you can test it in game:
print(2^1024 >= math.huge) --->>> true
I just realized that when I checked out the page.
Thank you both!
Lua uses doubles for floating point numbers, the limit is after the highest number you can represent with a double value in the negative or positive direction. Depending on the storage type, you can look up their ranges and how they are handled. Inf is actually part of floating point and part of the way it is handled, not specific to Lua (so is NaN)
Is it possible for tick() or os.time() to reach this value and mess up code?
Yes but only if you are still running your code in the year 2849862293694200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.
gotem
this made me slightly depressed