hello! Gdevelop seems to overflow when a variable is exceeding 10^308
is there an easy way to go beyond? either that, or i need a way to circumvent the issue by using another expression (no idea what to do)
i’m making a linear graph that scale exponentially, i have horizontal lines that follow the precision of the graph when it scales. it works until 10^308 before it stops adding new lines
the expression:

Numbers are 64bit floating point numbers that have a max value of approximately 10^308.
Depending on the values used you could rewrite pow(10,a)/pow(10,b) as pow(10,a-b) if a or b are greater than 308 and a-b is less than 308.
Beyond that you could represent bigger numbers with two variables instead of one. Think scientific notation: m10^e, so you’d store the number as m and e, where m is a value from 0 to 1. For example a number like 1337 would be 0.133710^4 or m=0.1337, e=4. Doing math on these two variable numbers would require some algebraic juggling. But I’m sure there are JavaScript libraries that help with that.
2 Likes
hi!
thanks for your reply…
unfortunately… tried pow(10,a-b) and it doesn’t work nearly enough, my graph goes to power 32 000 something.
i thought about usong two variables too, but im not sure if it will work (io my case). i wanted to be sure before spending large amount of time on it…
you see, my graph is already expressed as a power of 10 ( 1000 = 3 etc…)
but i need to compare it with my graph lines using a power, otherwise they would move linearly
i just wanted to know if there was an easier way you know? like telling GD to use more than 64bit or something
The limitation is unrelated to GDevelop, it’s a floating point limitation that would exist in many programming languages.
There isn’t an easier way to get around it that I know of.
1 Like
So you’re trying to use pow(10,32000) in some cases?
Probably the simplest solution would be to scale down the values you’re using so none of the calculations result in an overflow. Especially considering when you graph it the values would be closer to the 0 to 1000 range.
1 Like