Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Using Boost.Math with High-Precision Floating-Point Libraries

Why use a high-precision library rather than built-in floating-point types?
Using Boost.Multiprecision
Using with GCC's __float128 datatype
Using With MPFR or GMP - High-Precision Floating-Point Library
Using e_float Library
Using NTL Library
Using without expression templates for Boost.Test and others

The special functions, distributions, constants and tools in this library can be used with a number of high-precision libraries, including:

The last four have some license restrictions; only Boost.Multiprecision when using the cpp_float backend can provide an unrestricted Boost license.

At present, the price of a free license is slightly lower speed.

Of course, the main cost of higher precision is very much decreased (usually at least hundred-fold) computation speed, and big increases in memory use.

Some libraries offer true arbitrary-precision arithmetic where the precision is limited only by available memory and compute time, but most are used at some arbitrarily-fixed precision, say 100 decimal digits, like Boost.Multiprecision cpp_dec_float_100.

Boost.Multiprecision can operate in both ways, but the most popular choice is likely to be about a hundred decimal digits, though examples of computing about a million digits have been demonstrated.


PrevUpHomeNext