Im attempting to store a number into a variable, but I need a variable that would go high enough to store it. :-\
10^16
or
100,000,000,000,000,000
I've heard of C having an unsigned long long int, but does C++ have anything that could hold it?
Printable View
Im attempting to store a number into a variable, but I need a variable that would go high enough to store it. :-\
10^16
or
100,000,000,000,000,000
I've heard of C having an unsigned long long int, but does C++ have anything that could hold it?
It depends on the compiler. The C++ language has no predefined maximum integer size.Quote:
Originally Posted by Campuschris
Regards,
Paul McKenzie
Try out std::numeric_limits<int>/std::numeric_limits<long> to see if you achieve the range you want. But this would be platform/implementation specific and can vary.
You can try libraries like BigInt/GMP that provide types with larger range and should help you.
You can use __int64 variables. It is NOT part of standard and is microsoft specific, but may get your job done if you are working with Visual Studio.