Skip to content

Latest commit

 

History

History
91 lines (63 loc) · 4.2 KB

File metadata and controls

91 lines (63 loc) · 4.2 KB

Boost.Decimal

Master Develop
Drone Build Status Build Status
Github Actions CI CI
Codecov codecov codecov
Fuzzing Fuzzing Fuzzing
Metal Metal 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.

How To Use The Library

This library is header only. It contains no other dependencies. Simply #include it and use it.

CMake

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)

vcpkg

Available in official vcpkg sources soon

Conan

Available in official conan sources soon

Supported Platforms

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:

  • GCC 8 and later
  • Clang 6 and later
  • Visual Studio 2019 and later
  • Intel OneAPI DPC++

Synopsis

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.

Full Documentation

The complete documentation can be found at: https://www.boost.org/doc/libs/develop/libs/decimal/doc/html/overview.html