Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ compile-time bignum library

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.

like image 250
Ambroz Bizjak Avatar asked May 24 '13 15:05

Ambroz Bizjak


1 Answers

Possibly Boost.Multiprecision is what you're looking for.

like image 160
DarkWanderer Avatar answered Dec 11 '22 07:12

DarkWanderer