Possible Duplicate:
Representing 128-bit numbers in C++
I need a way to store a 128 bit number, is there something besides unsigned long long that I can use?
Possible Duplicate:
Representing 128-bit numbers in C++
I need a way to store a 128 bit number, is there something besides unsigned long long that I can use?
You may want to use the GNU Multiple Precision Arithmetic Library.
ints.There's no primitive type for that.
Vlad's comment is a good solution for storage, but if you need to use that number for computations, you'll need to use a library allowing representation and arithmetic operations on big numbers.
You should start by taking a look at GMP:
It is not possible to store it in one primitive data type, so we have to be slightly more creative. Probably the easiest way to do it is to have the class hold two 64-bit ints, representing the upper and lower halves of the integer.
struct { uint64_t lo, hi; }?x86_64, GCC can generate a synthetic two-word type for you. Check if__uint128_tdoesn't already exist.