Skip to content

Commit 61469ac

Browse files
authored
Merge pull request #374 from cppalliance/doc_review
Documentation Review
2 parents 66e8e69 + f4d48d0 commit 61469ac

12 files changed

Lines changed: 47 additions & 32 deletions

doc/modules/ROOT/nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
** xref:examples.adoc#examples_rollover[Rollover Behavior]
77
** xref:examples.adoc#examples_bit[`<bit>` support]
88
** xref:examples.adoc#examples_numeric[`<numeric>` support (Saturating Arithmetic)]
9-
** xref:examples.adoc#examples_numeric[`<numeric>` support (Numeric Logarithms)]
9+
** xref:examples.adoc#examples_numeric_algorithms[`<numeric>` support (Numeric Algorithms)]
1010
** xref:examples.adoc#examples_mixed_sign[Mixed Signedness Arithmetic]
1111
** xref:examples.adoc#examples_to_string[String Conversion (to_string)]
1212
** xref:examples.adoc#examples_boost_math_random[Boost Math and Random Integration]

doc/modules/ROOT/pages/api_reference.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ https://www.boost.org/LICENSE_1_0.txt
2020

2121
| xref:literals.adoc[`boost::int128::literals`]
2222
| User-defined literals for 128-bit integers
23+
24+
| xref:charconv.adoc[`boost::charconv`]
25+
| `to_chars` and `from_chars` overloads for 128-bit integers (requires Boost.Charconv)
2326
|===
2427

2528
[#api_types]
@@ -146,7 +149,7 @@ Listed by analogous STL header.
146149
|===
147150
| Function | Description
148151

149-
| `abs`
152+
| xref:int128_t.adoc#i128_math_operators[`abs`]
150153
| Absolute value
151154
|===
152155

@@ -359,8 +362,8 @@ Listed by analogous STL header.
359362
| xref:format.adoc#std_format[`<boost/int128/format.hpp>`]
360363
| Formatting integration for pass:[C++20] `<format>`
361364

362-
| xref:uint128_t.adoc[`<boost/int128/int128.hpp>`]
363-
| The `int128_t` and `uint128_t` types
365+
| `<boost/int128/int128.hpp>`
366+
| The xref:uint128_t.adoc[`uint128_t`] and xref:int128_t.adoc[`int128_t`] types
364367

365368
| xref:stream.adoc[`<boost/int128/iostream.hpp>`]
366369
| Iostream overloads for `int128_t` and `uint128_t`

doc/modules/ROOT/pages/config.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ These macros allow customization of library behavior. User-configurable macros s
1919

2020
[#enable_cuda]
2121
- `BOOST_INT128_ENABLE_CUDA`: Defining this macro allows both types and selected functions to be run on both host and device when compiling with NVCC.
22-
Allowed functions have `BOOST_IN128_HOST_DEVICE` as part of their function signature in their documentation.
22+
Allowed functions have `BOOST_INT128_HOST_DEVICE` as part of their function signature in their documentation.
2323

2424
[#no_int128]
2525
- `BOOST_INT128_NO_BUILTIN_INT128`: The user may define this when they do not want the internal implementations to rely on builtin `pass:[__int128]` or `pass:[unsigned __int128]` types.

doc/modules/ROOT/pages/examples.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ signed_value / 4U = 0
304304
include::example$math_and_random.cpp[]
305305
----
306306
307-
.Expected Output
307+
.Example Output (values vary per run)
308308
[listing]
309309
----
310310
=== uint128_t ===

doc/modules/ROOT/pages/file_structure.adoc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,25 @@ The entire library can be consumed via `<boost/int128.hpp>`, or by independently
1616
| Header | Description
1717

1818
| `<boost/int128.hpp>`
19-
| The complete library (includes all headers below)
19+
| Convenience header (includes most headers below; does not include `charconv.hpp`, `fmt_format.hpp`, or `random.hpp`)
2020

2121
| xref:bit.adoc[`<boost/int128/bit.hpp>`]
2222
| Bit manipulation functions
2323

2424
| xref:charconv.adoc[`<boost/int128/charconv.hpp>`]
25-
| Character conversion (`to_chars`/`from_chars`)
25+
| Character conversion (`to_chars`/`from_chars`); requires Boost.Charconv headers
2626

2727
| xref:api_reference.adoc#api_macro_literals[`<boost/int128/climits.hpp>`]
2828
| C-style limit macros (`BOOST_INT128_INT128_MAX`, etc.)
2929

30+
| xref:config.adoc[`<boost/int128/config.hpp>`]
31+
| Configuration macros
32+
3033
| xref:cstdlib.adoc[`<boost/int128/cstdlib.hpp>`]
3134
| Division with quotient and remainder (`div`)
3235

3336
| xref:format.adoc[`<boost/int128/fmt_format.hpp>`]
34-
| `pass:[{fmt}]` library support
37+
| `pass:[{fmt}]` library support; requires the `pass:[{fmt}]` library
3538

3639
| xref:format.adoc[`<boost/int128/format.hpp>`]
3740
| C++20 `std::format` support
@@ -50,4 +53,10 @@ The entire library can be consumed via `<boost/int128.hpp>`, or by independently
5053

5154
| xref:numeric.adoc[`<boost/int128/numeric.hpp>`]
5255
| Numeric functions (`gcd`, `lcm`, saturating arithmetic)
56+
57+
| `<boost/int128/random.hpp>`
58+
| Traits for usage with Boost.Random
59+
60+
| xref:string.adoc[`<boost/int128/string.hpp>`]
61+
| `to_string` overloads
5362
|===

doc/modules/ROOT/pages/format.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Examples:
3737
| `{:*^6d}` | `"**42**"` (centered with asterisks)
3838
|===
3939

40-
NOTE: When no alignment is specified but a width is given (e.g., `{:6d}`), zero-padding is applied from the left.
40+
NOTE: When no alignment is specified but a `0` prefix and width are given (e.g., `{:06d}`), zero-padding is applied from the left. Without the `0` prefix (e.g., `{:6d}`), space-padding is applied instead, matching `std::format` behavior.
4141

4242
== Sign
4343

doc/modules/ROOT/pages/i128_benchmarks.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ https://www.boost.org/LICENSE_1_0.txt
1212

1313
The benchmarks below represent the time in microseconds it takes to perform 20'000'000 operations between two values of random width (e.g. 2x1 words, 1x2 words, etc.).
1414
On most platforms we use the builtin `\__int128` as the reference benchmark.
15-
When this is unavailable (such as on 32-bit architectures) we us `boost::multiprecision::int128_t` (abbreviated as `boost::mp::int128_t`) as it is widely used, and known to be portable.
15+
When this is unavailable (such as on 32-bit architectures) we use `boost::multiprecision::int128_t` (abbreviated as `boost::mp::int128_t`) as it is widely used, and known to be portable.
1616
On MSVC platforms we use as reference `std::_Signed128` from the header `<__msvc_int128.hpp>` since this is bundled with their compiler.
1717

1818
[#i128_linux]
@@ -56,7 +56,7 @@ image::i128_graphs/linux/x64_relative_performance.png[x64 Relative Performance,
5656
image::i128_graphs/linux/ARM64_benchmarks.png[ARM64 Benchmark Results, width=100%]
5757
////
5858

59-
image::i128_graphs/linux/ARM64_relative_performance.png[x64 Relative Performance, width=100%]
59+
image::i128_graphs/linux/ARM64_relative_performance.png[ARM64 Relative Performance, width=100%]
6060

6161
=== S390x
6262

doc/modules/ROOT/pages/mixed_type_ops.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ BOOST_INT128_HOST_DEVICE constexpr bool operator!=(uint128_t lhs, int128_t rhs);
110110
BOOST_INT128_HOST_DEVICE constexpr bool operator!=(int128_t lhs, uint128_t rhs);
111111
----
112112

113-
If the `int128_t` argument is less than 0 returns `false`.
113+
If the `int128_t` argument is less than 0 returns `true`.
114114
Otherwise, returns the same as `static_cast<uint128_t>(lhs) != static_cast<uint128_t>(rhs)`.
115115

116116
=== Less Than
@@ -152,7 +152,7 @@ If `lhs` is type `int128_t` returns `false` if `lhs < 0`
152152
If `rhs` is type `int128_t` returns `true` if `rhs < 0`
153153
Otherwise, returns the same as `static_cast<uint128_t>(lhs) > static_cast<uint128_t>(rhs)`.
154154

155-
=== Less Than or Equal To
155+
=== Greater Than or Equal To
156156

157157
[source, c++]
158158
----
@@ -167,7 +167,7 @@ Otherwise, returns the same as `static_cast<uint128_t>(lhs) pass:[>=] static_cas
167167

168168
== Arithmetic
169169

170-
If you define xref:config.adoc#sign_compare[`BOOST_INT128_ALLOW_SIGN_CONVERSION`], the operators have the following behavior.
170+
If you define xref:config.adoc#sign_conversion[`BOOST_INT128_ALLOW_SIGN_CONVERSION`], the operators have the following behavior.
171171

172172
=== Addition
173173

doc/modules/ROOT/pages/numeric.adoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ Should the `TargetIntegerType` not be able to represent the value of the `Librar
5757
namespace boost {
5858
namespace int128 {
5959
60-
constexpr <typename LibraryIntegerType, typename TargetIntegerType>
61-
BOOST_INT128_HOST_DEVICE constexpr TargetIntegerType saturate_cast(LibraryIntegerType x) noexcept;
60+
template <typename TargetType>
61+
BOOST_INT128_HOST_DEVICE constexpr TargetType saturate_cast(uint128_t value) noexcept;
62+
63+
template <typename TargetType>
64+
BOOST_INT128_HOST_DEVICE constexpr TargetType saturate_cast(int128_t value) noexcept;
6265
6366
} // namespace int128
6467
} // namespace boost

doc/modules/ROOT/pages/overview.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ When using pass:[C++20] or newer, the library can be consumed as a module `impor
2424
GCC and Clang offer `__int128` as a non-standard extension on 64-bit targets, but it lacks `std::numeric_limits` specializations, `<iostream>` support, and is absent entirely on MSVC.
2525
Multiprecision libraries can fill the gap, but typically at the cost of a larger `sizeof` and additional overhead (e.g., Boost.Multiprecision always has an extra word).
2626
Boost.Int128 solves this by providing types that are exactly 128-bits on every platform.
27-
Operation implementations rely on compiler intrinsic where available for native performance, and optimized software implementations elsewhere.
28-
The types provided by the library also have native support being running on GPU using CUDA, along with many of the functions.
27+
Operation implementations rely on compiler intrinsics where available for native performance, and optimized software implementations elsewhere.
28+
The types provided by the library also natively support running on GPUs using CUDA, along with many of the functions.
2929

3030
== Use Cases
3131

0 commit comments

Comments
 (0)