I have a code which gives output larger than 32 bits, so I need a big integer class which can do addition and multiplication with bi integers. Anybody knows how to write BigInteger class to implement my code? So I can see the bigger integer outputs.

Printable View

- 10-25-2011makonikorhow to implement a big int class in c++?
I have a code which gives output larger than 32 bits, so I need a big integer class which can do addition and multiplication with bi integers. Anybody knows how to write BigInteger class to implement my code? So I can see the bigger integer outputs.

- 10-25-2011laserlight
You could consider the C++ wrapper for the GNU MP library.

- 10-25-2011makonikor
I do not want to include a library, I want to implement the big integer class to my code

- 10-25-2011laserlightQuote:

Originally Posted by**makonikor**

(You could "cheat" by taking at look at how GMP does it, of course. iMalc also has a bignum library implementation among his useful classes that might (or might not) be easier to understand than GMP's implementation.) - 10-25-2011Salem
> I want to implement the big integer class to my code

So do you actually know how to do addition, subtraction, multiplication and division on paper?

I mean, given

Code:`12345678901234567890 +`

987654321987654321