big numbers

hi....
i have a problem
we know that when we wanna to use big numbers we can t use (int,long int,...)
how we can solve this problem.....
for example when we want to get the value of 50! what should we do?!
my compiler is Dev C++....
Last edited on
If it doesn't have be accurate, you can use double.
For everything else, there's GMP:
http://gmplib.org/
int can go up to somewhere close to 1,000,000,000 I believe. Do you really need a number larger than that?
Last edited on
Since 50! equals 30414093201713378043612608166064768844377641568960512000000000000, he probably does.
int can go up to somewhere close to 1,000,000,000 I believe.

No. An unsigned int can go up to 4,294,967,295. 2^32 = 4,294,967,296 (and then - 1 to account for the value 0 to get ...295)
Last edited on
Or 18,446,744,073,709,551,615 if running 64-bit.
for numbers that they have about 200 or grether digits what we should do!?
Athar wrote:
For everything else, there's GMP:
http://gmplib.org/

@jsmith... I thought I remember seeing a boost library for handling large numbers, am I thinking of something else?
There are a few people who have wanted to begin or have begun such a project, but as yet the attempts are not mature, nor are they currently a part of Boost's libraries. You can google around for implementations...

There is little interest for Boost committee members because you already get nice C and C++ bignum from GMP, which is a very mature and heavily optimized package.
Or, if you are the hobbyist kind of programmer, you might want to create such a class yourself ;)
Well mate, try to use gmp library functions. Its public available on the links given above. Its really fun to play with those big nos using gmp.

Regards,

Rocky
Topic archived. No new replies allowed.