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
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.
You could consider the C++ wrapper for the GNU MP library.
I do not want to include a library, I want to implement the big integer class to my code
Ah. What ideas do you have in mind right now?Quote:
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.)
> 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
do you know what to do without pressing buttons on a calculator?Code:12345678901234567890 +
987654321987654321