very big natural number

Nov 17, 2010 at 6:02pm
Is there a data type that can store any natural number? The natural number may be 0 or 121281237129432746237 or even longer.
Nov 17, 2010 at 6:04pm
Nov 17, 2010 at 6:50pm
Is there a data type that can store any natural number?


No, of course not!

But check out the link above, since it will permit you to store arbitrarily large numbers up to system memory constraints.
Nov 17, 2010 at 6:55pm
The largest int data type available in C++ is uint64_t. You can also call it unsigned long long or __hyper. However, this type is still limited. It will only go up to 2^64-1. There are complicated methods you can use to do calculations with large numbers, but using gmp would be easier.
Last edited on Nov 17, 2010 at 7:00pm
Nov 17, 2010 at 8:25pm
Another nice library:
http://www.ttmath.org/ttmath
Nov 18, 2010 at 6:08am
Thank you! How can I install gmp in a windows-like system? Is there an istalling programme or ''include'' file?
Topic archived. No new replies allowed.