Skip to content

Commit 0e1b7dd

Browse files
committed
Add JOSS paper
1 parent b53f5b5 commit 0e1b7dd

3 files changed

Lines changed: 184 additions & 0 deletions

File tree

.github/workflows/draft-pdf.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Draft PDF
2+
on: [push]
3+
4+
jobs:
5+
paper:
6+
runs-on: ubuntu-latest
7+
name: Paper Draft
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
- name: Build draft PDF
12+
uses: openjournals/openjournals-draft-action@master
13+
with:
14+
journal: joss
15+
# This should be the path to the paper within your repo.
16+
paper-path: paper/paper.md
17+
- name: Upload
18+
uses: actions/upload-artifact@v4
19+
with:
20+
name: paper
21+
# This is the output path where Pandoc will write the compiled
22+
# PDF. Note, this should be the same directory as the input
23+
# paper.md
24+
path: paper/paper.pdf

paper/paper.bib

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@article{IEEE754:2008,
2+
author={},
3+
journal={IEEE Std 754-2008},
4+
title={IEEE Standard for Floating-Point Arithmetic},
5+
year={2008},
6+
volume={},
7+
number={},
8+
pages={1-70},
9+
keywords={IEEE Standards;Floating-point arithmetic;Microprocessors;Software;Hardware;Trademarks;754-2008;arithmetic;binary;computer;decimal;exponent;floating-point;format;interchange;NaN;number;rounding;significand;subnormal},
10+
doi={10.1109/IEEESTD.2008.4610935}
11+
}
12+
13+
@misc{boost,
14+
author = {Boost Authors},
15+
title = {Boost C++ Libraries Version},
16+
year = {2025},
17+
publisher = {GitHub},
18+
journal = {GitHub repository},
19+
url = {https://github.com/boostorg/boost}
20+
}
21+
22+
@misc{ibm_libdfp,
23+
author = {IBM Corporation},
24+
title = {Decimal Floating Point C Library},
25+
year = {2010},
26+
publisher = {GitHub},
27+
journal = {GitHub repository},
28+
url = {https://github.com/libdfp/libdfp}
29+
}
30+
31+
@misc{intel_dfp,
32+
author = {Intel Corporation},
33+
title = {Intel(R) Decimal Floating-Point Math Library v2.3},
34+
year = {2023},
35+
publisher = {netlib},
36+
journal = {Netlib repository},
37+
url = {https://www.netlib.org/misc/intel/}
38+
}
39+
40+
@inproceedings{Cowlishaw:2003,
41+
author = {Cowlishaw, Michael F.},
42+
title = {Decimal Floating-Point: Algorism for Computers},
43+
month = {June},
44+
year = {2003},
45+
doi = {10.1109/ARITH.2003.1207666},
46+
url = {https://speleotrove.com/decimal/IEEE-cowlishaw-arith16.pdf}
47+
}

paper/paper.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: 'Boost.Decimal: A C++14 Library for Decimal Floating Point Arithmetic'
3+
tags:
4+
- C++
5+
authors:
6+
- name: Matt Borland
7+
orcid: 0009-0005-8183-4254
8+
equal-contrib: true
9+
affiliation: 1
10+
- name: Christopher Kormanyos
11+
equal-contrib: true
12+
affiliation: 2
13+
affiliations:
14+
- name: The C++ Alliance
15+
index: 1
16+
- name: Independent Researcher, Germany
17+
index: 2
18+
date: 04 February 2025
19+
bibliography: paper.bib
20+
---
21+
22+
# Summary
23+
24+
Boost.Decimal is a header-only, C++14 implementation of IEEE 754 decimal floating-point arithmetic types (`decimal32_t`, `decimal64_t` and `decimal128_t`), integrating seamlessly with the C++ Standard Template Library and other Boost Libraries [@boost].
25+
The library is available at [https://github.com/boostorg/decimal](https://github.com/boostorg/decimal), and in the Boost distribution with most standard package managers starting from version 1.91.
26+
27+
# Statement of need
28+
29+
In the 2008 revision of IEEE 754 [@IEEE754:2008], decimal floating-point arithmetic was standardized.
30+
These types are critical in applications where decimal numbers must be represented exactly, such as financial software [@Cowlishaw:2003].
31+
Binary floating-point representations cannot precisely store common decimal values like 0.1, leading to subtle rounding errors that accumulate over repeated calculations.
32+
Prior to Boost.Decimal, no cross-platform C++ library provided IEEE 754 decimal arithmetic or the associated types.
33+
34+
# State of the field
35+
36+
The two main implementations in this space are produced by IBM [@ibm_libdfp] and Intel [@intel_dfp], with the latter representing the industry standard.
37+
These libraries have two shortcomings that Boost.Decimal aims to address. First, both libraries are fundamentally C libraries.
38+
This can make integration into modern C++ applications awkward, and they lack support for C++-specific functionality provided in the Standard Library.
39+
Second, neither library is cross-platform; for instance, neither library supports ARM architectures.
40+
Boost.Decimal addresses both of these shortcomings.
41+
42+
# Software design
43+
44+
Boost.Decimal's design philosophy emphasizes ease of use, portability, and performance.
45+
46+
To make the library easy to consume, it requires only C++14 and is header-only with zero external dependencies.
47+
Users can simply clone the repository, add `#include <boost/decimal.hpp>`, and begin using the library, even with older toolchains such as `clang++-6`.
48+
Portability is a primary design concern, so we test the library on all three major operating system families (Linux, Windows, and macOS) across a variety of architectures including: x86-32, x86-64, ARM32, ARM64, S390X, and PPC64LE.
49+
Our continuous integration pipeline ensures consistent numerical results across all supported platforms.
50+
Performance is also a priority, both in absolute terms and relative to existing libraries.
51+
[Extensive benchmarking](https://www.boost.org/doc/libs/develop/libs/decimal/doc/html/overview.html) demonstrates that Boost.Decimal outperforms both the Intel and IBM libraries in many operations across a variety of platforms.
52+
Benchmark results and methodology are available in the repository documentation.
53+
54+
A minimal usage example showing the representation difference between decimal and binary floating point arithmetic:
55+
56+
```c++
57+
#include <boost/decimal.hpp> // This includes the entire decimal library
58+
#include <iostream>
59+
#include <iomanip>
60+
61+
int main()
62+
{
63+
using namespace boost::decimal::literals; // The literals are in their own namespace like std::literals
64+
65+
// First we show the result of 0.1 + 0.2 using regular doubles
66+
std::cout << std::fixed << std::setprecision(17)
67+
<< "Using doubles:\n"
68+
<< "0.1 + 0.2 = " << 0.1 + 0.2 << "\n\n";
69+
70+
// Construct the two decimal values
71+
// We construct using the literals defined by the library
72+
constexpr boost::decimal::decimal64_t a {0.1_DD};
73+
constexpr boost::decimal::decimal64_t b {0.2_DD};
74+
75+
// Now we display the result of the same calculation using decimal64_t
76+
std::cout << "Using decimal64_t:\n"
77+
<< "0.1_DD + 0.2_DD = " << a + b << std::endl;
78+
}
79+
```
80+
And the expected output is:
81+
```
82+
Using doubles:
83+
0.1 + 0.2 = 0.30000000000000004
84+
85+
Using decimal64_t:
86+
0.1_DD + 0.2_DD = 0.3000000000000000
87+
```
88+
89+
# Research Impact Statement
90+
91+
Boost.Decimal enables reproducible numerical research in domains where decimal precision is essential.
92+
The library's cross-platform consistency ensures that computational results are identical regardless of hardware architecture, a critical property for scientific reproducibility.
93+
94+
Quantitative finance research frequently involves calculations on currency values, interest rates, and transaction amounts that are inherently decimal.
95+
Binary floating-point approximations can introduce systematic biases in Monte Carlo simulations, risk calculations, and backtesting frameworks.
96+
Boost.Decimal allows researchers to eliminate these artifacts and produce results that match real-world financial systems.
97+
98+
Researchers investigating floating-point error accumulation can use Boost.Decimal as a reference implementation to compare against binary floating-point results.
99+
This facilitates studies on when decimal arithmetic provides meaningful accuracy improvements over binary representations.
100+
Additionally, unlike existing implementations, Boost.Decimal runs on ARM and other non-x86 architectures, enabling research on decimal arithmetic performance and applications in embedded systems and other platforms.
101+
102+
# AI usage disclosure
103+
104+
No generative AI tools were used in the development of this software, the writing
105+
of this manuscript, or the preparation of supporting materials.
106+
107+
# Acknowledgements
108+
109+
We acknowledge The C++ Alliance for sponsoring the development of this work.
110+
The library underwent peer review in January and October 2025 by domain experts before acceptance into the Boost library collection.
111+
We thank all of these reviewers for their time and contributions.
112+
113+
# References

0 commit comments

Comments
 (0)