In C++, is it possible to define arbitrary length integers?
So instead of having to use uint64_t
for anything in between 33 and 64 bit, I could define my own 34 bit, 36 bit, etc., integers.
The compiler has its own types like you did mention. long (32 bit on most platforms) and long long (64 bit on most platforms). If you need support for larger integers, you could use different libraries which limit the size of the integer to the size of your memory.
Libraries:
As you are living in C++ world use https://gmplib.org/
Should do the trick
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