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++14, 17, 20, 23 and beyond.
1317
1418# Notice
1519
16- This library is not an official boost library, and is under active development .
20+ Decimal is under active development and is not an official boost library.
1721
1822# How To Use The Library
1923
20- This library is header only, and contains no dependencies.
24+ This library is header only. It contains no other dependencies.
25+ Simply ` #include ` it and use it.
2126
2227## CMake
2328
24- ````
29+ ``` sh
2530git clone https://github.com/cppalliance/decimal
2631cd decimal
2732mkdir build && cd build
2833cmake .. OR cmake .. -DCMAKE_INSTALL_PREFIX=/your/custom/path
2934cmake --install .
30- ````
35+ ```
3136
3237## vcpkg
3338
34- ````
39+ ``` sh
3540git clone https://github.com/cppalliance/decimal
3641cd decimal
3742vcpkg install decimal --overlay-ports=ports/decimal
38- ````
43+ ```
3944
4045## Conan
4146
42- ````
47+ ``` sh
4348git clone https://github.com/cppalliance/decimal
4449conan create decimal/conan --build missing
45- ````
50+ ```
4651
4752# Supported Platforms
4853
49- Boost.Decimal is tested on Ubuntu (x86_64, s390x, and aarch64), macOS (x86_64, and Apple Silicon), and Windows (x86_64) with the following compilers:
54+ Boost.Decimal is tested on Ubuntu (x86_64, s390x, and aarch64),
55+ macOS (x86_64, and Apple Silicon), and Windows (x86_64)
56+ with the following compilers:
5057
5158* GCC 7 and later
5259* Clang 6 and later
5360* Visual Studio 2017 and later
5461
5562# Synopsis
5663
57- Decimal provides 3 types:
64+ Decimal provides 3 types:
5865
59- ````
66+ ``` cpp
6067namespace boost {
6168namespace decimal {
6269
@@ -66,21 +73,24 @@ class decimal128;
6673
6774} //namespace decimal
6875} //namespace boost
69- ````
76+ ```
77+
78+ These types operate like built-in floating point types.
79+ They have their own implementations of the Standard-Library functions
80+ (e.g. like those found in `<cmath>`, `<charconv>`, `<cstdlib>`, etc.).
7081
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.).
7282The entire library can be conveniently included with `#include <boost/decimal.hpp>`
7383
74- Using the types is simple:
84+ Using the decimal types is simple.
7585
76- ````
86+ ```cpp
7787#include <boost/decimal.hpp>
7888#include <iostream>
7989
8090int main()
8191{
8292 using boost::decimal::decimal32;
83-
93+
8494 constexpr decimal32 a {2, -1}; // Constructs the number 0.2
8595 constexpr decimal32 b {1, -1}; // Constructs the number 0.1
8696 auto sum {a + b};
@@ -95,11 +105,12 @@ int main()
95105
96106 return 0;
97107}
98- ````
108+ ```
99109
100- Same with using STL functions:
110+ This intuitive straightforwardness is the same when using Standard-Library
111+ functions (such as STL functions, ` <cmath> ` -like functions and the like).
101112
102- ````
113+ ``` cpp
103114#include < boost/decimal.hpp>
104115#include < cassert>
105116#include < cstring>
@@ -123,8 +134,13 @@ int main()
123134
124135 return 0;
125136}
126- ````
137+ ```
127138
128139# Full Documentation
129140
130141The complete documentation can be found at: https://cppalliance.org/decimal/decimal.html
142+
143+ ## References
144+
145+ [ 1 ] IEEE Computer Society. _IEEE_ _Standard_ _for_ _Floating-Point_ _Arithmetic_,
146+ Std. IEEE:754 -2008 , August 29 , 2008 (doi:10.1109 /IEEESTD.2008.4610935 ).
0 commit comments