Is there any compile-time library (template metaprogramming) for arbitrary-precision arithmetic in C++?
I need this to help with fixed-point arithmetic and binary scaling in my program for AVR microcontrollers. For example, when two numbers each with their own bounds are multiplied, the bignums would be used to compute the bounds of the result, and move the fraction point in the inputs and/or outputs as appropriate. But the bounds of the result may not be representable in the standard integer types.
Possibly Boost.Multiprecision is what you're looking for.
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