Hey everyone, recently I’ve been working on a game that could possibly reach some very high numbers (at most decillion but probably a little lower) and need some help figuring out how to work with them in case I ever have to. I know how I’d go about setting up something like BigNums and there are a ton of posts about it already, but is this even necessary? If I go over the 9Qn data limit and begin getting precision errors can my game still run fine with it?
The numbers in question would just be money and multipliers which, if someone’s hitting a decillion of, would not need to be exactly accurate anyways. Basically I just need clarification with the possible accuracy errors with doing this and how math with numbers this large would work (like subtracting purchase amounts from a players money for shops)
If it’s just decillion and you can accept some precision lost, doubles (i.e. number value) are enough. (hell, even floats are enough). The first result on “floating point precision calculator” is a good tool is wonderful for know how much the math will differ
But if you absolutely cannot have any precision lost, you can do it like how floating-point numbers are implemented ( using tables for numbers that store the mantissa and exponent).
Thanks for the reply, I can have precision lost as I’d assume if someone is hitting values that high they’ll be making like 1N at least so precision lower wouldn’t really matter. I’m also abbreviating numbers so it’s not like anyone will actually see. I will stick to just continuing with number values for this and save myself the effort.