how can we use very big numbers in a c++ coding ...
eg a number which is some 40 digit long... i just found out tat there is some data type known as biginteger ... but its not working in turbo c even after installin reqiured files...
can anyone help in this problem..
i need a complete explanation on big integers,.....

how can we use very big numbers in a c++ coding ...
eg a number which is some 40 digit long... i just found out tat there is some data type known as biginteger ... but its not working in turbo c even after installin reqiured files...
can anyone help in this problem..
i need a complete explanation on big integers,.....

Hi,

Existing datatypes are not going to solve this problem of yours. If you need do computation on really big numbers, you'll need to use one of those libraries that support infinite precision arithmetic (or write your own code which can do it). If I were you, I'd do myself a favour and use one of the existing implementations.

For instance, there's the MP BigNum Library.

I've computed the factorial of 9858 here: http://gmplib.org/cgi-bin/gmp_calc.pl?expr=9858!

You may read about infinite precision arithmetic here: http://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic

Cheers,
Rajesh R Subramanian
[CodeProject MVP]
[Microsoft MVP]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.