- Home /
how do i store a really big number?
I am making a clicker game and i am trying to store (up to) a really big number. i've been looking arround on the internet for a couple of HOURS but i just can't find anything useful. i saw some stuff about int and int64 and uint and long and double and ulong. i even saw something about how to chain ints to store large numbers but none of them worked. i just don't know what to do anymore... the maximal number i am trying to store is 1.000.000.000.000.000.000.000.000.000.000 i hope someone can help
Answer by Larry-Dietz · Dec 29, 2017 at 06:01 PM
The traditional way to store very large numbers is with scientific notation.
For example, the number you mentioned in your question, could be stored as 1 × 10^21
Here is a link to an online scientific notation calculator. In addition to the calculator, they also explain how scientific notation works, and the steps needed to convert a large number to the notation, and how to convert back to the original number.
https://www.calculatorsoup.com/calculators/math/scientific-notation-converter.php
Hope it helps, -Larry
Answer by FlaSh-G · Dec 29, 2017 at 06:01 PM
Just because you didn't get it to work does not mean it's not a (or the) proper way. Chaining ints would work very well.none of them worked
There is a struct named "BigInteger" in System.Numerics but you'd have to enable .NET 4.6 for that.