by Aardwolf · 13y ago · 0 comments
"The key in this case is using C99's long long data type. It provides the biggest primitive storage C can manage (128-bits on 32-bit machines and 256-bits on a 64-bit machine) and it runs really, really fast."
Isn't long long "typically" 64-bit? (I know the C standard doesn't actually specify any actual size).
What platform does this long long type really give you the full 128 or 256 bits on?
And do 64-bit CPU's indeed support 256 bit integer types? If so, what can I do to play with it!! C does not provide it for me on Linux!
Thanks :)
#include <stdint.h>
then, use uint64_t for unsigned and int64_t for signed. If you want 128 bits, in gcc you can use __uint128_t (it has two extra underscores at the beginning because that size is nonstandard), but I don't think there is support for 256 bit integers.
Try a big integer library: http://stackoverflow.com/questions/124332/c-handling-very-la...
typedef long long int int64_t;