...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The following back-ends provide rational number arithmetic:
Backend Type |
Header |
Radix |
Dependencies |
Pros |
Cons |
---|---|---|---|---|---|
|
boost/multiprecision/cpp_int.hpp |
2 |
None |
An all C++ Boost-licensed implementation. |
Slower than GMP. |
|
boost/multiprecision/gmp.hpp |
2 |
Very fast and efficient back-end. |
Dependency on GNU licensed GMP library. |
|
|
boost/multiprecision/tommath.hpp |
2 |
All C/C++ implementation that's Boost Software Licence compatible. |
Slower than GMP. |
|
|
boost/multiprecision/rational_adaptor.hpp |
N/A |
none |
All C++ adaptor that allows any integer back-end type to be used as a rational type. |
Requires an underlying integer back-end type. |
|
boost/rational.hpp |
N/A |
None |
A C++ rational number type that can used with any |
The expression templates used by |