I have an integer variable, that can get a value larger than 4294967295.
What type should I use for it (long long, or double, or something else)?
Use long long
and if possible add a compile-time assertion that this type is wide enough (smth like sizeof( long long ) >= 8
).
double
is for floating-point, not integer.
Try:
http://gmplib.org/ big num.
http://mattmccutchen.net/bigint/ big int.
I've used neither, but I've used similiar things in Java.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With