• Hey! Register here to create your account, engage with the community, and talk about what is new!

How do I increase the maximum number?

HackerDragon9999

Forum adept
Joined
Jan 18, 2023
Messages
118
Reaction score
21
I'm trying to make a Collatz conjecture plot, but the number breaks somewhere between 1 and 10 trillion. How do I increase this limit?
 

RodaballoXD

New member
Joined
Mar 18, 2024
Messages
20
Reaction score
1
Maybe you could have multiple variables to store that number. You could have one named "thousand", which will store a value from 0 to 999. And you can have another one called "million" that also stores values from 0 to 999. To read that number you'll have to get the values as strings, and if you put billion, million, thousand variables in that order, you should get the right value. Each iteration, you divide by 2 every variable or multiply by 3 every variable and add 1 to the "thousand" variable. Then check if any variable is higher than or equal to 1000, to substract 1000 from that variable and add 1 to the next variable. Let's say "thousand" equals 1274 and "million" equals 70 after the iteration. "Thousand" now equals 274 and "million" equals 71. The same for decimal numbers after dividing. You substract 0.5 from the higher variable and add 500 to the lower one. I don't know what could be the best way to optimize this in terms of codespace and/or lag. Hopefully someone with more experience with coding can tell you exactly how to do this, but I hope this idea helps.
 

xmap

Member
Overlord
Joined
Sep 9, 2020
Messages
36
Reaction score
13
create your own number system, play "integer limit bypass", might be something that will peak your interest. the concept of increasing the number limit there is pretty easy to follow, so try that
 
Top Bottom