[try Beta version]
Not logged in

 
 
Very Large numbers

Oct 10, 2012 at 3:07am
I'm making a game and need some very large numbers.

My goal is to be able to at least hold 30 digits of accuracy (28 to be exact), but I'm not sure if double is actually able to hold it. I've been looking at the accuracy for the double and it says it holds up to ~15 digits of accuracy, but looking around it seems to be able to hold more.

Should I make another data holder or is double big enough? If double isn't big enough how many should I use in the composite struct?
Last edited on Oct 10, 2012 at 4:13am
Oct 10, 2012 at 5:41am
What operations do you need to perform with these numbers? You may be able to get away with writing a small bignum class.
Oct 10, 2012 at 1:15pm
I'm looking to use it for gravity calculations and resource limiting calculations. So the basic four (+-*/) plus square root, throw in an = for initialization, and that's about it.
Oct 10, 2012 at 3:06pm
Then it may be best to just use something like GMP.
Oct 10, 2012 at 4:42pm
I've never heard of GMP. What is it?
Oct 10, 2012 at 4:52pm
It's a library for processing numbers of abritrary precision, so it does exactly what you want.
Oct 10, 2012 at 5:04pm
Cool, Thank you. I'll look into it.
Topic archived. No new replies allowed.