Skip to content

Commit 588e26e

Browse files
authored
Merge pull request #980 from cppalliance/develop
Merge to master for v5.1.0
2 parents 45b7976 + 806883d commit 588e26e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+941
-347
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ jobs:
119119
container: ubuntu:24.04
120120
install:
121121
- g++-14-multilib
122+
- toolset: gcc-14
123+
cxxstd: "03,11,14,17,20,23,2c"
124+
cxxflags: -fno-exceptions
125+
address_model: "64"
126+
os: ubuntu-latest
127+
container: ubuntu:24.04
128+
install:
129+
- g++-14-multilib
122130
- toolset: gcc-14
123131
cxxstd: "03,11,14,17,20,23,2c"
124132
address_model: "32"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ int main()
153153

154154
# Full Documentation
155155

156-
The complete documentation can be found at: https://cppalliance.org/decimal/decimal.html
156+
The complete documentation can be found at: https://develop.decimal.cpp.al/decimal/overview.html
157157

158158
## References
159159

codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ comment:
3030
layout: 'reach,diff,flags,files,footer'
3131
behavior: default
3232
require_changes: no
33+
34+
ignore:
35+
# This is covered here: https://github.com/cppalliance/int128
36+
- include/boost/decimal/detail/int128/*

conan/conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class CharconvConan(ConanFile):
2121
name = "boost_decimal"
22-
version = "3.0.0"
22+
version = "5.0.0"
2323
description = "Boost provides free peer-reviewed portable C++ source libraries"
2424
url = "https://github.com/cppalliance/decimal"
2525
homepage = "https://github.com/cppalliance/decimal"

doc/decimal-playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ output:
1010
dir: html
1111
ui:
1212
bundle:
13-
url: https://github.com/boostorg/unordered-ui-bundle/raw/c80db72a7ba804256beb36e3a46d9c7df265d8d7/ui-bundle.zip
13+
url: https://github.com/boostorg/website-v2-docs/releases/download/ui-master/ui-bundle.zip
1414
output_dir: decimal/_

doc/modules/ROOT/nav.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@
1010
** xref:examples.adoc#examples_bit_conversions[Bit Conversions]
1111
** xref:examples.adoc#examples_finance[Financial Applications]
1212
** xref:examples.adoc#examples_boost_math[Boost.Math Integration]
13+
** xref:examples.adoc#examples_format[Formatting]
14+
*** xref:examples.adoc#examples_std_format[`<format>`]
15+
*** xref:examples.adoc#examples_fmt_format[+{fmt}+]
16+
** xref:examples.adoc#examples_print[`<print>`]
1317
* xref:api_reference.adoc[]
1418
** xref:api_reference.adoc#api_ref_types[Types]
1519
** xref:api_reference.adoc#api_ref_structs[Structs]
1620
** xref:api_reference.adoc#api_ref_enums[Enums]
1721
** xref:api_reference.adoc#api_ref_constants[Constants]
1822
** xref:api_reference.adoc#api_ref_macros[Macros]
23+
* xref:file_structure.adoc[]
1924
* xref:generic_decimal.adoc[IEEE 754 Decimal Types]
2025
** xref:decimal32_t.adoc[]
2126
** xref:decimal64_t.adoc[]
@@ -40,6 +45,8 @@
4045
* xref:functional.adoc[]
4146
* xref:limits.adoc[]
4247
* xref:config.adoc[]
48+
** xref:config.adoc#configuration_user[User Configuration]
49+
** xref:config.adoc#configuration_automatic[Automatic Configuration]
4350
* xref:benchmarks.adoc[]
4451
** xref:benchmarks.adoc#x64_linux_benchmarks[x64 Linux]
4552
** xref:benchmarks.adoc#x64_windows_benchmarks[x64 Windows]

doc/modules/ROOT/pages/api_reference.adoc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,20 @@ enums, constants and macros that are provided in this library.
4646
[#api_ref_macros]
4747
== Macros
4848

49-
See: xref:config.adoc[configuration]
49+
=== User Configuration
50+
51+
- xref:config.adoc#configuration_user[`BOOST_DECIMAL_DISABLE_CASSERT`]
52+
- xref:config.adoc#configuration_user[`BOOST_DECIMAL_DISABLE_IOSTREAM`]
53+
- xref:config.adoc#configuration_user[`BOOST_DECIMAL_DISABLE_CLIB`]
54+
- xref:config.adoc#configuration_user[`BOOST_DECIMAL_DISABLE_EXCEPTIONS`]
55+
- xref:config.adoc#configuration_user[`BOOST_DECIMAL_ALLOW_IMPLICIT_CONVERSIONS`]
56+
- xref:config.adoc#configuration_user[`BOOST_DECIMAL_FAST_MATH`]
57+
- xref:config.adoc#configuration_user[`BOOST_DECIMAL_DEC_EVAL_METHOD`]
58+
59+
=== Automatic Configuration
60+
61+
- xref:config.adoc#configuration_automatic[`BOOST_DECIMAL_CXX20_CONSTEXPR`]
62+
- xref:config.adoc#configuration_automatic[`BOOST_DECIMAL_CONSTEXPR`]
63+
- xref:config.adoc#configuration_automatic[`BOOST_DECIMAL_HAS_STD_CHARCONV`]
64+
- xref:config.adoc#configuration_automatic[`BOOST_DECIMAL_HAS_STD_STRING_VIEW`]
65+

doc/modules/ROOT/pages/benchmarks.adoc

Lines changed: 58 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ This section describes a range of performance benchmarks that have been run comp
1212

1313
The values in the ratio column are how many times longer running a specific operation takes in comparison to the same operation with a `double`.
1414

15-
IMPORTANT: On nearly all platforms there is hardware support for binary floating point math, so we are comparing hardware to software runtimes; *Decimal will be slower*
15+
IMPORTANT: On nearly all platforms, there is hardware support for binary floating point math, so we are comparing hardware to software runtimes; *Decimal will be slower*
1616

17-
NOTE: Both the results from Intel and GCC types are from very close, but not identical benchmark routines since they are written in C instead of C\++.
18-
We assume they are close enough, and the differences between the C and C++ compilers are small enough, for fair comparison
17+
NOTE: Both the results from Intel and GCC types are from very close, but not identical benchmark routines since they are written in C instead of pass:[C++].
18+
We assume they are close enough, and the differences between the C and pass:[C++] compilers are small enough, for fair comparison
1919

2020
== How to run the Benchmarks
2121
[#run_benchmarks_]
@@ -40,21 +40,22 @@ This is repeated 5 times to generate stable results.
4040

4141
=== Basic Mathematical Operations
4242

43-
The benchmark for these operations generates a random vector containing 20,000,000 elements and does operations `+`, `-`, `*`, `/` between `vec[i] and vec[i + 1]`.
44-
This is repeated 5 times to generate stable results.
43+
The benchmark for these operations generates a random vector containing 20 million elements and does operations `+`, `-`, `*`, `/` between `vec[i] and vec[i + 1]`.
44+
This is repeated five times to generate stable results.
4545

4646
=== `<charconv>`
4747

48-
Parsing and serializing number exactly is one of the key features of decimal floating point types, so we must compare the performance of `<charconv>`. For all the following the results compare against STL provided `<charconv>` for 20,000,000 conversions.
49-
Since `<charconv>` is fully implemented in software for each type the performance gap between built-in `float` and `double` vs `decimal32_t` and `decimal64_t` is significantly smaller (or the decimal performance is better) than the hardware vs software performance gap seen above for basic operations.
48+
Parsing and serializing number exactly is one of the key features of decimal floating point types, so we must compare the performance of `<charconv>`.
49+
For all the following the results compare we compare against STL provided `<charconv>` for 20 million conversions.
50+
Since `<charconv>` is fully implemented in software for each type the performance gap between built-in `float` and `double` vs `decimal32_t` and `decimal64_t` is significantly smaller (or the decimal performance is better) than the hardware vs. software performance gap seen above for basic operations.
5051

51-
To run these benchmarks yourself you will need a compiler with complete implementation of `<charconv>` and to run the benchmarks under C++17 or higher.
52-
At the time of writing this is limited to:
52+
To run these benchmarks yourself, you will need a compiler with complete implementation of `<charconv>` and to run the benchmarks under pass:[C++]17 or higher.
53+
At the time of writing, this is limited to:
5354

5455
- GCC 11 or newer
5556
- MSVC 19.24 or newer
5657

57-
These benchmarks are automatically disabled if your compiler does not provide feature complete `<charconv>` or if the language standard is set to C++14.
58+
These benchmarks are automatically disabled if your compiler does not provide feature complete `<charconv>` or if the language standard is set to pass:[C++]14.
5859

5960
[#x64_linux_benchmarks]
6061
== x64 Linux
@@ -394,23 +395,23 @@ Intel Compiler:
394395
| 103,796
395396
| 1.000
396397
| `decimal32_t`
397-
| 2,125,437
398-
| 20.477
398+
| 2,134,312
399+
| 20.563
399400
| `decimal64_t`
400-
| 5,973,337
401-
| 57.549
401+
| 5,399,276
402+
| 52.018
402403
| `decimal128_t`
403-
| 9,482,403
404-
| 91.356
404+
| 10,012,578
405+
| 96.464
405406
| `decimal_fast32_t`
406-
| 1,011,695
407-
| 9.747
407+
| 1,558,774
408+
| 15.018
408409
| `decimal_fast64_t`
409-
| 2,138,793
410-
| 20.606
410+
| 1,597,873
411+
| 15.394
411412
| `decimal_fast128_t`
412-
| 8,277,721
413-
| 79.750
413+
| 8,105,004
414+
| 78.086
414415
| Intel `Decimal32`
415416
| 1,561,213
416417
| 15.041
@@ -436,20 +437,20 @@ GCC:
436437
| 2,396,732
437438
| 29.708
438439
| `decimal64_t`
439-
| 4,824,865
440-
| 59.805
440+
| 4,021,720
441+
| 49.850
441442
| `decimal128_t`
442-
| 10,751,669
443-
| 133.270
443+
| 10,677,625
444+
| 132.352
444445
| `decimal_fast32_t`
445-
| 1,103,023
446-
| 13.672
446+
| 1,083,011
447+
| 13.424
447448
| `decimal_fast64_t`
448-
| 2,384,925
449-
| 29.562
449+
| 1,851,520
450+
| 22.950
450451
| `decimal_fast128_t`
451-
| 8,332,936
452-
| 103.289
452+
| 8,121,160
453+
| 100.664
453454
| GCC `_Decimal32`
454455
| 5,082,812
455456
| 63.002
@@ -781,23 +782,23 @@ Run using an Intel i9-11900k chipset running Windows 11 and Visual Studio 17.14.
781782
| 89,317
782783
| 1.000
783784
| `decimal32_t`
784-
| 3,402,467
785-
| 38.094
785+
| 3,048,254
786+
| 34.128
786787
| `decimal64_t`
787-
| 4,663,830
788-
| 52.217
788+
| 3,282,819
789+
| 36.755
789790
| `decimal128_t`
790-
| 18,167,111
791-
| 203.400
791+
| 16,648,799
792+
| 186.401
792793
| `decimal_fast32_t`
793-
| 2,363,121
794-
| 26.458
794+
| 2,059,743
795+
| 23.061
795796
| `decimal_fast64_t`
796-
| 6,578,828
797-
| 73.657
797+
| 5,105,018
798+
| 57.156
798799
| `decimal_fast128_t`
799-
| 12,341,026
800-
| 138.171
800+
| 11,587,763
801+
| 129,737
801802
|===
802803

803804
=== `from_chars`
@@ -1120,23 +1121,23 @@ Run using a Macbook pro with M4 Max chipset running macOS Sequoia 15.5 and homeb
11201121
| 17,145
11211122
| 1.000
11221123
| `decimal32_t`
1123-
| 1,705,827
1124-
| 97.951
1124+
| 1,732,611
1125+
| 101.056
11251126
| `decimal64_t`
1126-
| 3,912,831
1127-
| 224.682
1127+
| 3,558,094
1128+
| 207.529
11281129
| `decimal128_t`
1129-
| 8,727,582
1130-
| 501.153
1130+
| 8,985,521
1131+
| 524.090
11311132
| `decimal_fast32_t`
1132-
| 1,054,418
1133-
| 60.547
1133+
| 1,075,184
1134+
| 62.711
11341135
| `decimal_fast64_t`
1135-
| 2,404,072
1136-
| 138.046
1136+
| 2,027,533
1137+
| 118.258
11371138
| `decimal_fast128_t`
1138-
| 7,981,650
1139-
| 458.320
1139+
| 7,583,016
1140+
| 442.287
11401141
|===
11411142

11421143
=== `from_chars`
@@ -1249,7 +1250,7 @@ Run using a Macbook pro with M4 Max chipset running macOS Sequoia 15.5 and homeb
12491250
| `decimal64_t`
12501251
| 3,309,343
12511252
| 0.673
1252-
| `decimal128_t
1253+
| `decimal128_t`
12531254
| 5,962,030
12541255
| 1.212
12551256
| `decimal_fast32_t`

doc/modules/ROOT/pages/cfenv.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ IMPORTANT: The rounding mode can only be changed at runtime. All `constexpr` cal
2424

2525
[source, c++]
2626
----
27+
#include <boost/decimal/cfenv.hpp>
28+
2729
namespace boost {
2830
namespace decimal {
2931

doc/modules/ROOT/pages/cfloat.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ The following macros analogous to those from `<cfloat>` for the decimal floating
1212

1313
[source, c++]
1414
----
15+
#include <boost/decimal/cfloat.hpp>
16+
1517
1618
// Number of digits in the coefficient
1719
#define BOOST_DECIMAL_DEC32_MANT_DIG std::numeric_limits<boost::decimal::decimal32_t>:digits10

0 commit comments

Comments
 (0)