views:

1555

answers:

3

Hi,

I am still a student, and I find project Euler very fun.

sometimes the question requires calculations that are bigger than primitive types. I know you can implement it but I am too lazy to do this,

So I tried few libraries,

MAPM :: very good performance, but it provides only big floats, with the possibility to check if it is an integer. very good to accept input, but nasty to provide output, and compiles like magic with Visual C++ 2008 express.

bigint :: a small one, but needs a re engineering in many parts. Very simple to use, but very limited power, and very slow compared to others. only big integers.

ttmath :: the most beautiful one I have tried until now!, just some files to include and you have unbelievable power/simplicity. Compiles like magic in Visual C++ 2008 express. It is fast, because it provides fixed-length numbers. It is built using Metaprogramming in C++. The only disadvantage I see, is that numbers are not arbitrary in length at run-time, but you can have 1024K numbers when writing code very easily,

ttmath::UInt<1024 * 1024> reallyHugeUnsignedInteger;

It provides three types: signed, unsigned and float.

I tried to compile gmp under VC2008 express, but I failed! I know it is the best, but no where easy to compile for a beginner under VC2008 express, I appreciate also if you point to a tutorial to compile gmp under VC.

EDIT :: If you know how to compile gmp using VC 2008, Please explain to me and get the bounty :)

EITD :: It seems that I was not using the right terms, So here is the magical GMP for Widnows! works with VC 2008 :) MPIR

A: 

GMP. Simple API, been around forever.

Edit: Oh, you tried that. I'd really try it again, it is the best.

As I said, I never got it to work under VC :(
AraK
suggestion: for the benefit of other SO readers, next time please add links. I'm doing it for you now.
jwfearn
+5  A: 

Here are a couple of links regarding GMP and Visual Studio 2008:

GMP Install Help at CodeGuru

GMP Compile Guide at The Edge Of Nowhere (this one looks really thorough)

Kristo
+3  A: 

... or just try out PARI/GP http://pari.math.u-bordeaux.fr/

Flavius Suciu