Files
multiprecision/doc/tutorial_floats.qbk
2025-12-29 17:07:40 +01:00

34 lines
2.0 KiB
Plaintext

[/
Copyright 2011 - 2025 John Maddock.
Copyright 2013 - 2019 Paul A. Bristow.
Copyright 2013 - 2025 Christopher Kormanyos.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:floats Floating-point Types]
The following back-ends provide floating-point arithmetic:
[table
[[Backend Type][Header][Radix][Dependencies][Pros][Cons]]
[[`cpp_bin_float<N>`][boost/multiprecision/cpp_bin_float.hpp][2][None][Header only, all C++ implementation. Boost licence.][Approximately 2x slower than the [mpfr] or [gmp] libraries.]]
[[`cpp_dec_float<N>`][boost/multiprecision/cpp_dec_float.hpp][10][None][Header only, all C++ implementation. Boost licence.][Approximately 2x slower than the [mpfr] or [gmp] libraries.]]
[[`gmp_float<N>`][boost/multiprecision/gmp.hpp][2][[gmp]][Very fast and efficient back-end.][Dependency on GNU licensed [gmp] library.]]
[[`mpfr_float_backend<N>`][boost/multiprecision/mpfr.hpp][2][[gmp] and [mpfr]][Very fast and efficient back-end, with its own standard library implementation.][Dependency on GNU licensed [gmp] and [mpfr] libraries.]]
[[`float128_backend`][boost/multiprecision/float128.hpp][2][Either [quadmath] or the Intel C++ Math library.][Very fast and efficient back-end for 128-bit floating-point values (113-bit mantissa, equivalent to FORTRAN's QUAD real)][Depends on the compiler being either recent GCC or Intel C++ versions.]]
[[`cpp_double_fp_backend<T>`][boost/multiprecision/cpp_double_fp.hpp][2][None][Header only, all C++ implementation. Boost licence.][Approximately 2x double-`float`, `double`, `long double` or `boost::float128_type` designed for lower-precision, higher run-time performance.]]
]
[include tutorial_cpp_bin_float.qbk]
[include tutorial_cpp_dec_float.qbk]
[include tutorial_gmp_float.qbk]
[include tutorial_mpfr_float.qbk]
[include tutorial_float128.qbk]
[include tutorial_cpp_double_fp_backend.qbk]
[include tutorial_float_eg.qbk]
[endsect] [/section:floats floating-point Numbers]