11# Decimal
2+
23| | Master | Develop |
34| ------------------| -------------------------------------------------------------------------------------------------------------------------------------------------------------------| -------------|
45| Drone | [ ![ Build Status] ( https://drone.cpp.al/api/badges/cppalliance/decimal/status.svg?ref=refs/heads/master )] ( https://drone.cpp.al/cppalliance/decimal ) | [ ![ Build Status] ( https://drone.cpp.al/api/badges/cppalliance/decimal/status.svg?ref=refs/heads/develop )] ( https://drone.cpp.al/cppalliance/decimal ) |
5- | Github Actions | [ ![ CI] ( https://github.com/cppalliance/decimal/actions/workflows/ci.yml/badge.svg?branch=master )] ( https://github.com/cppalliance/decimal/actions/workflows/ci.yml ) | [ ![ CI] ( https://github.com/cppalliance/decimal/actions/workflows/ci.yml/badge.svg?branch=develop )] ( https://github.com/cppalliance/decimal/actions/workflows/ci.yml )
6- | Codecov | [ ![ codecov] ( https://codecov.io/gh/cppalliance/decimal/branch/master/graph/badge.svg?token=drvY8nnV5S )] ( https://codecov.io/gh/cppalliance/decimal ) | [ ![ codecov] ( https://codecov.io/gh/cppalliance/decimal/graph/badge.svg?token=drvY8nnV5S )] ( https://codecov.io/gh/cppalliance/decimal ) |
7- | Fuzzing | [ ![ Fuzzing] ( https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml/badge.svg?branch=master )] ( https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml ) | [ ![ Fuzzing] ( https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml/badge.svg?branch=develop )] ( https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml ) |
6+ | Github Actions | [ ![ CI] ( https://github.com/cppalliance/decimal/actions/workflows/ci.yml/badge.svg?branch=master )] ( https://github.com/cppalliance/decimal/actions/workflows/ci.yml ) | [ ![ CI] ( https://github.com/cppalliance/decimal/actions/workflows/ci.yml/badge.svg?branch=develop )] ( https://github.com/cppalliance/decimal/actions/workflows/ci.yml )
7+ | Codecov | [ ![ codecov] ( https://codecov.io/gh/cppalliance/decimal/branch/master/graph/badge.svg?token=drvY8nnV5S )] ( https://codecov.io/gh/cppalliance/decimal ) | [ ![ codecov] ( https://codecov.io/gh/cppalliance/decimal/graph/badge.svg?token=drvY8nnV5S )] ( https://codecov.io/gh/cppalliance/decimal ) |
8+ | Fuzzing | [ ![ Fuzzing] ( https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml/badge.svg?branch=master )] ( https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml ) | [ ![ Fuzzing] ( https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml/badge.svg?branch=develop )] ( https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml ) |
89
910---
1011
11- An implementation of IEEE 754 decimal floating point numbers.
12- It is header only, and requires C++14
12+ Decimal is an implementation of IEEE-754:2008 decimal floating point numbers.
13+ See also [ 1] .
14+
15+ The library is is header-only, and requires C++14.
16+ It is compatible through C++17, 20, 23 and beyond.
1317
1418# Notice
1519
@@ -21,28 +25,28 @@ This library is header only, and contains no dependencies.
2125
2226## CMake
2327
24- ````
28+ ``` sh
2529git clone https://github.com/cppalliance/decimal
2630cd decimal
2731mkdir build && cd build
2832cmake .. OR cmake .. -DCMAKE_INSTALL_PREFIX=/your/custom/path
2933cmake --install .
30- ````
34+ ```
3135
3236## vcpkg
3337
34- ````
38+ ``` sh
3539git clone https://github.com/cppalliance/decimal
3640cd decimal
3741vcpkg install decimal --overlay-ports=ports/decimal
38- ````
42+ ```
3943
4044## Conan
4145
42- ````
46+ ``` sh
4347git clone https://github.com/cppalliance/decimal
4448conan create decimal/conan --build missing
45- ````
49+ ```
4650
4751# Supported Platforms
4852
@@ -56,7 +60,7 @@ Boost.Decimal is tested on Ubuntu (x86_64, s390x, and aarch64), macOS (x86_64, a
5660
5761Decimal provides 3 types:
5862
59- ````
63+ ``` cpp
6064namespace boost {
6165namespace decimal {
6266
@@ -66,21 +70,24 @@ class decimal128;
6670
6771} //namespace decimal
6872} //namespace boost
69- ````
73+ ```
74+
75+ These types operate like built-in floating point types.
76+ They have their own implementations of the Standar-Library functions
77+ (e.g. like those found in `<cmath>`, `<charconv>`, `<cstdlib>`, etc.).
7078
71- These types operate like built-in floating point types, and have their own implementations of the STL functions (e.g. cmath, charconv, cstdlib, etc.).
7279The entire library can be conveniently included with `#include <boost/decimal.hpp>`
7380
74- Using the types is simple:
81+ Using the decimal types is simple.
7582
76- ````
83+ ```cpp
7784#include <boost/decimal.hpp>
7885#include <iostream>
7986
8087int main()
8188{
8289 using boost::decimal::decimal32;
83-
90+
8491 constexpr decimal32 a {2, -1}; // Constructs the number 0.2
8592 constexpr decimal32 b {1, -1}; // Constructs the number 0.1
8693 auto sum {a + b};
@@ -95,11 +102,12 @@ int main()
95102
96103 return 0;
97104}
98- ````
105+ ```
99106
100- Same with using STL functions:
107+ This intuitive straightforwardness is the same when using Standard-Library
108+ functions (such as ` <cmath> ` -like functions).
101109
102- ````
110+ ``` cpp
103111#include < boost/decimal.hpp>
104112#include < cassert>
105113#include < cstring>
@@ -123,8 +131,13 @@ int main()
123131
124132 return 0;
125133}
126- ````
134+ ```
127135
128136# Full Documentation
129137
130138The complete documentation can be found at: https://cppalliance.org/decimal/decimal.html
139+
140+ ## References
141+
142+ [ 1 ] IEEE Computer Society. _IEEE_ _Standard_ _for_ _Floating-Point_ _Arithmetic_,
143+ IEEE Std 754 -2008 , August 29 , 2008 (doi:10.1109 /IEEESTD.2008.4610935 ).
0 commit comments