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,.....
- 2 Contributors
- forum1 Reply
- 9 Views
- 9 Years Discussion Span
- comment Latest Post by Rajesh R Subram
Rajesh R Subram 127
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]
Edited
by Rajesh R Subram: n/a