cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
How to manage a very big number?
How to manage a very big number?
Jul 30, 2009 at 9:03am UTC
Acacia
(1)
I am running a code that computes a very big numbers. The program works untill it reachs its limit then all the rest turns out to be infinity. The number grows exponentially. Could u please let me know how to handle this problem?
Thanks in advance,
Jul 30, 2009 at 9:35am UTC
Bazzy
(6281)
Use a library as GMP
http://gmplib.org/
http://www.delorie.com/gnu/docs/gmp/gmp_73.html
Last edited on
Jul 30, 2009 at 9:36am UTC
Jul 31, 2009 at 1:55pm UTC
meepokman
(26)
Try using a "long double" or "long int" for your variable declarations instead of just "double" or "int".
Jul 31, 2009 at 2:23pm UTC
QWERTYman
(461)
I believe on most systems, even
long
long
int
or
unsigned
long
long
int
are supported types. They're very big.
Very.
Jul 31, 2009 at 2:33pm UTC
helios
(17574)
128 bits is not that big. Have you seen the 46th Mersenne Prime? 12.8 million decimal digits.
Besides, long long is not standard.
Topic archived. No new replies allowed.