You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Matt Borland 5f81a78cdb
Update README to reflect C++14 compiler requirement (#557)
2 weeks ago
.circleci Clean text pow2 list and correct circle CI names 2 years ago
.drone Improve printing out configuration info in CI runs. (#522) 5 months ago
.github/workflows Add testing on MSVC 3 months ago
config Cycle CI 2 years ago
doc Update history. 4 months ago
example Add forward declaration header. 5 months ago
include/boost/multiprecision Make sure cpp_int::eval_convert_to is noexcept as advertised. 3 weeks ago
meta Update cxxstd field (#538) 3 months ago
performance Replace 0 as null pointer constant with nullptr 11 months ago
plots Convert file encoding. 3 years ago
test Make sure changing the global precision options also changes the value for the current thread. 1 month ago
tools Initial merge of cpp_bin_float code from sandbox. 10 years ago
.clang-format clang-format: apply new format to (almost) everything. 4 years ago Add ARM64 and s390x testing. (#519) 5 months ago
.gitattributes Move top-level boost directory over to "devel" (temporarily) 16 years ago
.gitignore Add clion configs to gitignore 1 year ago
CMakeLists.txt Add cmake install (#533) 4 months ago
LICENSE Add license file 1 year ago Update README to reflect C++14 compiler requirement (#557) 2 weeks ago
index.html Tweak docs and regenerate. 11 years ago

Boost Multiprecision Library

ANNOUNCEMENT: This library now requires a compliant C++14 compiler.

Master Develop
Drone Build Status Build Status
Github Actions Build Status Build Status

The Multiprecision Library provides integer, rational, floating-point, complex and interval number types in C++ that have more range and precision than C++'s ordinary built-in types. The big number types in Multiprecision can be used with a wide selection of basic mathematical operations, elementary transcendental functions as well as the functions in Boost.Math. The Multiprecision types can also interoperate with the built-in types in C++ using clearly defined conversion rules. This allows Boost.Multiprecision to be used for all kinds of mathematical calculations involving integer, rational and floating-point types requiring extended range and precision.

Multiprecision consists of a generic interface to the mathematics of large numbers as well as a selection of big number back ends, with support for integer, rational and floating-point types. Boost.Multiprecision provides a selection of back ends provided off-the-rack in including interfaces to GMP, MPFR, MPIR, TomMath as well as its own collection of Boost-licensed, header-only back ends for integers, rationals, floats and complex. In addition, user-defined back ends can be created and used with the interface of Multiprecision, provided the class implementation adheres to the necessary concepts.

Depending upon the number type, precision may be arbitrarily large (limited only by available memory), fixed at compile time (for example 50 or 100 decimal digits), or a variable controlled at run-time by member functions. The types are expression-template-enabled for better performance than naive user-defined types.

The full documentation is available on


Defining BOOST_MP_STANDALONE allows Boost.Multiprecision to be used with the only dependency being Boost.Config. Our package on this page already includes a copy of Boost.Config so no other donwloads are required. Some functionality is reduced in this mode. A static_assert message will alert you if a particular feature has been disabled by standalone mode. Boost.Math standalone mode is compatiable, and recommended if special functions are required for the floating point types.

Support, bugs and feature requests

Bugs and feature requests can be reported through the Gitub issue tracker (see open issues and closed issues).

You can submit your changes through a pull request.

There is no mailing-list specific to Boost Multiprecision, although you can use the general-purpose Boost mailing-list using the tag [multiprecision].


Clone the whole boost project, which includes the individual Boost projects as submodules (see boost+git doc):

git clone
cd boost
git submodule update --init

The Boost Multiprecision Library is located in libs/multiprecision/.

Running tests

First, build the B2 engine by running in the root of the boost directory. This will generate B2 configuration in project-config.jam.


Now make sure you are in libs/multiprecision/test. You can either run all the tests listed in Jamfile.v2 or run a single test:

../../../b2                        <- run all tests
../../../b2 test_complex           <- single test