| Master | Develop | |
|---|---|---|
| Drone | ||
| Github Actions | ||
| Codecov | ||
| Fuzzing | ||
| Metal |
Boost.Decimal is an implementation of IEEE 754 and ISO/IEC DTR 24733 Decimal Floating Point numbers. The library is header-only, has no dependencies, and requires C++14.
This library is header only. It contains no other dependencies.
Simply #include it and use it.
git clone https://github.com/boostorg/decimal
cd decimal
mkdir build && cd build
cmake .. OR cmake .. -DCMAKE_INSTALL_PREFIX=/your/custom/path
cmake --build . --target install
then you can use find_package(boost_decimal REQUIRED)
Available in official vcpkg sources.
Available in official conan sources as part of the Boost distribution.
Boost.Decimal is tested natively on Ubuntu (x86_64, s390x, and aarch64), macOS (x86_64, and Apple Silicon), and Windows (x32 and x64); as well as emulated PPC64LE and ARM Cortex-M using QEMU with the following compilers:
Decimal provides 3 IEEE-754 compliant types:
namespace boost {
namespace decimal {
class decimal32_t;
class decimal64_t;
class decimal128_t;
} //namespace decimal
} //namespace boost
and also 3 similar but non-compliant types with improved runtime performance:
namespace boost {
namespace decimal {
class decimal_fast32_t;
class decimal_fast64_t;
class decimal_fast128_t;
} //namespace decimal
} //namespace boost
These types operate like built-in floating point types.
They have their own implementations of the Standard-Library functions
(e.g. like those found in <cmath>, <charconv>, <cstdlib>, etc.).
The entire library can be conveniently included with #include <boost/decimal.hpp>
Using the decimal types is straightforward and can be learned by example. Their usage closely resembles that of built-in binary floating point types by design.
The complete documentation can be found at: https://www.boost.org/doc/libs/develop/libs/decimal/doc/html/overview.html
<h1>Boost.Decimal</h1> <table> <thead> <tr> <th align="left"></th> <th align="left">Master</th> <th align="left">Develop</th> </tr> </thead> <tbody> <tr> <td align="left">Drone</td> <td align="left"><a href="https://drone.cpp.al/boostorg/decimal"><img src="https://drone.cpp.al/api/badges/boostorg/decimal/status.svg?ref=refs/heads/master" alt="Build Status" /></a></td> <td align="left"><a href="https://drone.cpp.al/boostorg/decimal"><img src="https://drone.cpp.al/api/badges/boostorg/decimal/status.svg?ref=refs/heads/develop" alt="Build Status" /></a></td> </tr> <tr> <td align="left">Github Actions</td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/ci.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/ci.yml/badge.svg?branch=master" alt="CI" /></a></td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/ci.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/ci.yml/badge.svg?branch=develop" alt="CI" /></a></td> </tr> <tr> <td align="left">Codecov</td> <td align="left"><a href="https://codecov.io/gh/boostorg/decimal"><img src="https://codecov.io/gh/boostorg/decimal/branch/master/graph/badge.svg?token=drvY8nnV5S" alt="codecov" /></a></td> <td align="left"><a href="https://codecov.io/gh/boostorg/decimal"><img src="https://codecov.io/gh/boostorg/decimal/graph/badge.svg?token=drvY8nnV5S" alt="codecov" /></a></td> </tr> <tr> <td align="left">Fuzzing</td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/fuzz.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/fuzz.yml/badge.svg?branch=master" alt="Fuzzing" /></a></td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/fuzz.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/fuzz.yml/badge.svg?branch=develop" alt="Fuzzing" /></a></td> </tr> <tr> <td align="left">Metal</td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/metal.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/metal.yml/badge.svg?branch=master" alt="Metal" /></a></td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/metal.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/metal.yml/badge.svg?branch=develop" alt="Metal" /></a></td> </tr> </tbody> </table> <hr /> <p>Boost.Decimal is an implementation of <a href="https://standards.ieee.org/ieee/754/6210/">IEEE 754</a> and <a href="https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2849.pdf">ISO/IEC DTR 24733</a> Decimal Floating Point numbers. The library is header-only, has no dependencies, and requires C++14.</p> <h1>How To Use The Library</h1> <p>This library is header only. It contains no other dependencies. Simply <code>#include</code> it and use it.</p> <h2>CMake</h2> <pre class="highlightjs highlight"><code class="language-sh hljs">git clone https://github.com/boostorg/decimal cd decimal mkdir build && cd build cmake .. OR cmake .. -DCMAKE_INSTALL_PREFIX=/your/custom/path cmake --build . --target install </code></pre> <p>then you can use <code>find_package(boost_decimal REQUIRED)</code></p> <h2>vcpkg</h2> <p>Available in <a href="https://vcpkg.io/en/package/boost-decimal">official vcpkg sources</a>.</p> <h2>Conan</h2> <p>Available in <a href="https://conan.io/center/recipes/boost">official conan sources</a> as part of the Boost distribution.</p> <h1>Supported Platforms</h1> <p>Boost.Decimal is tested natively on Ubuntu (x86_64, s390x, and aarch64), macOS (x86_64, and Apple Silicon), and Windows (x32 and x64); as well as emulated PPC64LE and ARM Cortex-M using QEMU with the following compilers:</p> <ul> <li>GCC 8 and later</li> <li>Clang 6 and later</li> <li>Visual Studio 2019 and later</li> <li>Intel OneAPI DPC++</li> </ul> <h1>Synopsis</h1> <p>Decimal provides 3 IEEE-754 compliant types:</p> <pre class="highlightjs highlight"><code class="language-cpp hljs">namespace boost { namespace decimal { class decimal32_t; class decimal64_t; class decimal128_t; } //namespace decimal } //namespace boost </code></pre> <p>and also 3 similar but non-compliant types with improved runtime performance:</p> <pre class="highlightjs highlight"><code class="language-cpp hljs">namespace boost { namespace decimal { class decimal_fast32_t; class decimal_fast64_t; class decimal_fast128_t; } //namespace decimal } //namespace boost </code></pre> <p>These types operate like built-in floating point types. They have their own implementations of the Standard-Library functions (e.g. like those found in <code><cmath></code>, <code><charconv></code>, <code><cstdlib></code>, etc.). The entire library can be conveniently included with <code>#include <boost/decimal.hpp></code></p> <p>Using the decimal types is straightforward and can be learned by <a href="https://develop.decimal.cpp.al/decimal/examples.html">example</a>. Their usage closely resembles that of built-in binary floating point types by design.</p> <h1>Full Documentation</h1> <p>The complete documentation can be found at: https://www.boost.org/doc/libs/develop/libs/decimal/doc/html/overview.html</p>
<h1>Boost.Decimal</h1> <table> <thead> <tr> <th align="left"></th> <th align="left">Master</th> <th align="left">Develop</th> </tr> </thead> <tbody> <tr> <td align="left">Drone</td> <td align="left"><a href="https://drone.cpp.al/boostorg/decimal"><img src="https://drone.cpp.al/api/badges/boostorg/decimal/status.svg?ref=refs/heads/master" alt="Build Status" /></a></td> <td align="left"><a href="https://drone.cpp.al/boostorg/decimal"><img src="https://drone.cpp.al/api/badges/boostorg/decimal/status.svg?ref=refs/heads/develop" alt="Build Status" /></a></td> </tr> <tr> <td align="left">Github Actions</td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/ci.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/ci.yml/badge.svg?branch=master" alt="CI" /></a></td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/ci.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/ci.yml/badge.svg?branch=develop" alt="CI" /></a></td> </tr> <tr> <td align="left">Codecov</td> <td align="left"><a href="https://codecov.io/gh/boostorg/decimal"><img src="https://codecov.io/gh/boostorg/decimal/branch/master/graph/badge.svg?token=drvY8nnV5S" alt="codecov" /></a></td> <td align="left"><a href="https://codecov.io/gh/boostorg/decimal"><img src="https://codecov.io/gh/boostorg/decimal/graph/badge.svg?token=drvY8nnV5S" alt="codecov" /></a></td> </tr> <tr> <td align="left">Fuzzing</td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/fuzz.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/fuzz.yml/badge.svg?branch=master" alt="Fuzzing" /></a></td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/fuzz.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/fuzz.yml/badge.svg?branch=develop" alt="Fuzzing" /></a></td> </tr> <tr> <td align="left">Metal</td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/metal.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/metal.yml/badge.svg?branch=master" alt="Metal" /></a></td> <td align="left"><a href="https://github.com/boostorg/decimal/actions/workflows/metal.yml"><img src="https://github.com/boostorg/decimal/actions/workflows/metal.yml/badge.svg?branch=develop" alt="Metal" /></a></td> </tr> </tbody> </table> <hr /> <p>Boost.Decimal is an implementation of <a href="https://standards.ieee.org/ieee/754/6210/">IEEE 754</a> and <a href="https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2849.pdf">ISO/IEC DTR 24733</a> Decimal Floating Point numbers. The library is header-only, has no dependencies, and requires C++14.</p> <h1>How To Use The Library</h1> <p>This library is header only. It contains no other dependencies. Simply <code>#include</code> it and use it.</p> <h2>CMake</h2> <pre class="highlightjs highlight"><code class="language-sh hljs">git clone https://github.com/boostorg/decimal cd decimal mkdir build && cd build cmake .. OR cmake .. -DCMAKE_INSTALL_PREFIX=/your/custom/path cmake --build . --target install </code></pre> <p>then you can use <code>find_package(boost_decimal REQUIRED)</code></p> <h2>vcpkg</h2> <p>Available in <a href="https://vcpkg.io/en/package/boost-decimal">official vcpkg sources</a>.</p> <h2>Conan</h2> <p>Available in <a href="https://conan.io/center/recipes/boost">official conan sources</a> as part of the Boost distribution.</p> <h1>Supported Platforms</h1> <p>Boost.Decimal is tested natively on Ubuntu (x86_64, s390x, and aarch64), macOS (x86_64, and Apple Silicon), and Windows (x32 and x64); as well as emulated PPC64LE and ARM Cortex-M using QEMU with the following compilers:</p> <ul> <li>GCC 8 and later</li> <li>Clang 6 and later</li> <li>Visual Studio 2019 and later</li> <li>Intel OneAPI DPC++</li> </ul> <h1>Synopsis</h1> <p>Decimal provides 3 IEEE-754 compliant types:</p> <pre class="highlightjs highlight"><code class="language-cpp hljs">namespace boost { namespace decimal { class decimal32_t; class decimal64_t; class decimal128_t; } //namespace decimal } //namespace boost </code></pre> <p>and also 3 similar but non-compliant types with improved runtime performance:</p> <pre class="highlightjs highlight"><code class="language-cpp hljs">namespace boost { namespace decimal { class decimal_fast32_t; class decimal_fast64_t; class decimal_fast128_t; } //namespace decimal } //namespace boost </code></pre> <p>These types operate like built-in floating point types. They have their own implementations of the Standard-Library functions (e.g. like those found in <code><cmath></code>, <code><charconv></code>, <code><cstdlib></code>, etc.). The entire library can be conveniently included with <code>#include <boost/decimal.hpp></code></p> <p>Using the decimal types is straightforward and can be learned by <a href="https://develop.decimal.cpp.al/decimal/examples.html">example</a>. Their usage closely resembles that of built-in binary floating point types by design.</p> <h1>Full Documentation</h1> <p>The complete documentation can be found at: https://www.boost.org/doc/libs/develop/libs/decimal/doc/html/overview.html</p>