Representing Huge Numbers
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.
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++.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement