A simple Big Int Library?

Hi all. I'm just beginning to use c++, now I would like to fiddle with large numbers such as the first 100 of Fibonacci. As far as I can tell vc++exprss can't handle it. And now, after having looked around a bit at MPIR BigInt etc. my head is spinning. Is there an easy to use bigint lib? that allow me to use normal c++ mathematical functions ( * % + - that sort of thing ) and is somewhat easy to install and use? Most of these instructions are either to short for a layman or just for C. Anyone know some good ones?
closed account (D80DSL3A)
I've seen the GNU MP Bignum library recommended on this site. http://gmplib.org/
I haven't used it though so I don't know if it's any easier to install and use than the ones you listed.

Another option: There was a contest in the lounge about 6 months ago to write a big integer library. http://www.cplusplus.com/forum/lounge/32041/
Five members submitted entries (including myself). They are all class based so using one would involve including one or two more files in your project.
I think that all of the entries included overloads for +, - and *. The class usage is pretty straightforward. My entry overloads / and % as well. Links to the codes for each entry may be found in the thread.

EDIT: I just finished adding support for operators +=, -=, *=, /=, %=, ++ and -- (both in prefix and postfix forms).
Last edited on
I think MPIR is a GMP port to vc++. Thanks you for linking the contest though, I'll be checking yours out soon.

I found ttmath, also small neat and easy. I think I'll be using yours and that for the times to come. Thanks again.
Topic archived. No new replies allowed.