Sign in to follow this  
GenuineXP

Representing Huge Numbers

Recommended Posts

I thought I'd take a crack at implementing a math system that can deal with (very simple) equations and solve for unknowns. While I was thinking of ways this may be accomplished, I began to wonder... just how can I deal with really huge numbers? What if I need to store a number with 1000 digits, for example? How is this done? I know it can be done; I've seen plenty of software do it before. Is there a way to create a C++ class to represent such an enourmous value? Also, would it be possible to use templates to indicate the type of the huge number? (So HugeNumber<Decimal> would store huge floating point values and HugeNumber<Integer> would store huge integer values.) Thanks! I'm really curious about this one.

Share this post


Link to post
Share on other sites
Look up "Arbitrary Precision Math". Also, I've seen people mention the BigNum library, but I'm not familiar enough with it to even be sure that's the right name, let alone for C++.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this