Thursday, July 30, 2009

Big integer in c++?

in java there is a bigInteger class (or funstion, don't know) which can handle very big numbers even with 500 digits.





Is there any class, function, library, or any thing in c++ that can handle very big numbers, like adding two big number

Big integer in c++?
you can always make your own class for big Integers, it wouldn't be too hard, start with two integer variables, when one changes to be more than a single integer can hold, start the second integer to 1 and roll over again, you can now go to INTEGER_MAX_VALUE sqared, if you do three you can go for INTEGER_MAX_VALUE cubed...
Reply:Not that big, that I'm aware of. It can be done, but you have to do it or use someone else's library to extend this capability. Below is a good reference page on C / C++ data types and how to find the maximum sizes for each. I hope this will help you out. Pivy.


No comments:

Post a Comment