Skip to content

Commit 70b6521

Browse files
authored
Merge branch 'develop' into local_metal_benching
2 parents 9db1c1f + 1e011c2 commit 70b6521

Some content is hidden

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

98 files changed

+1643
-957
lines changed

doc/modules/ROOT/nav.adoc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
* xref:overview.adoc[]
22
* xref:basics.adoc[]
33
* xref:examples.adoc[]
4+
** xref:examples.adoc#examples_construction[Construction]
5+
** xref:examples.adoc#examples_promotion[Type Promotion]
6+
** xref:examples.adoc#examples_charconv[`<charconv>`]
7+
** xref:examples.adoc#examples_rounding_mode[Rounding Mode]
8+
** xref:examples.adoc#examples_generic_programming[Generic Programming]
9+
** xref:examples.adoc#examples_literals_constants[Literals and Constants]
10+
** xref:examples.adoc#examples_bit_conversions[Bit Conversions]
11+
** xref:examples.adoc#examples_finance[Financial Applications]
12+
** xref:examples.adoc#examples_boost_math[Boost.Math Integration]
413
* xref:api_reference.adoc[]
5-
* xref:generic_decimal.adoc[]
14+
** xref:api_reference.adoc#api_ref_types[Types]
15+
** xref:api_reference.adoc#api_ref_structs[Structs]
16+
** xref:api_reference.adoc#api_ref_enums[Enums]
17+
** xref:api_reference.adoc#api_ref_constants[Constants]
18+
** xref:api_reference.adoc#api_ref_macros[Macros]
19+
* xref:generic_decimal.adoc[IEEE 754 Decimal Types]
620
** xref:decimal32_t.adoc[]
721
** xref:decimal64_t.adoc[]
822
** xref:decimal128_t.adoc[]
9-
* xref:fast_types.adoc[]
23+
* xref:fast_types.adoc[Non-IEEE 754 Decimal Types]
1024
** xref:decimal_fast32_t.adoc[]
1125
** xref:decimal_fast64_t.adoc[]
1226
** xref:decimal_fast128_t.adoc[]
@@ -27,6 +41,9 @@
2741
* xref:limits.adoc[]
2842
* xref:config.adoc[]
2943
* xref:benchmarks.adoc[]
44+
** xref:benchmarks.adoc#x64_linux_benchmarks[x64 Linux]
45+
** xref:benchmarks.adoc#x64_windows_benchmarks[x64 Windows]
46+
** xref:benchmarks.adoc#m4_mac_benchmarks[ARM64 macOS]
3047
* xref:design.adoc[]
3148
* xref:reference.adoc[]
3249
* xref:copyright.adoc[]

doc/modules/ROOT/pages/api_reference.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ https://www.boost.org/LICENSE_1_0.txt
1111
This section is a complete cross-reference to all the types, structures,
1212
enums, constants and macros that are provided in this library.
1313

14+
[#api_ref_types]
1415
== Types
1516

1617
=== IEEE 754 Compliant Types
@@ -25,20 +26,24 @@ enums, constants and macros that are provided in this library.
2526
- xref:decimal_fast64_t.adoc[decimal_fast64_t]
2627
- xref:decimal_fast128_t.adoc[decimal_fast128_t]
2728

29+
[#api_ref_structs]
2830
== Structures
2931

3032
- xref:charconv.adoc#to_chars_result[to_chars_result]
3133
- xref:charconv.adoc#from_chars_result[from_chars_result]
3234

35+
[#api_ref_enums]
3336
== Enums
3437

3538
- xref:charconv.adoc#chars_format[chars_format]
3639

40+
[#api_ref_constants]
3741
== Constants
3842

3943
- xref:charconv.adoc#charconv_limits[limits]
4044
- xref:numbers.adoc[numbers]
4145

46+
[#api_ref_macros]
4247
== Macros
4348

4449
See: xref:config.adoc[configuration]

doc/modules/ROOT/pages/basics.adoc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,33 @@ boost::decimal::decimal128_t pi {3.14};
5858

5959
NOTE: Due to the differences in decimal and binary floating point numbers there may be a difference in the resulting representation in decimal format, and thus it is not recommended to construct from binary floating point numbers
6060

61+
== Fundamental Operations
62+
63+
The fundamental operations of numerical type (e.g. `>`, `==`, `+`, etc.) are overloaded.
64+
65+
[source, c++]
66+
----
67+
#include <boost/decimal.hpp>
68+
#include <cassert>
69+
70+
int main()
71+
{
72+
constexpr boost::decimal::decimal32_t lhs {5};
73+
constexpr boost::decimal::decimal32_t rhs {1, -1};
74+
75+
assert(lhs > rhs);
76+
assert(lhs != rhs);
77+
assert(lhs + rhs > lhs);
78+
79+
auto new_lhs {lhs}; // Using auto is safe when constructring from existing decimal values
80+
new_lhs += lhs;
81+
82+
assert(lhs < new_lhs);
83+
84+
return 0;
85+
}
86+
----
87+
6188
== Using the Library
6289

6390
The entire library can be accessed using the convenience header `<boost/decimal.hpp>`.

0 commit comments

Comments
 (0)