File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed
Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ include::int128/charconv.adoc[]
3838
3939include::int128/stream.adoc[]
4040
41- include::int128/saturating .adoc[]
41+ include::int128/numeric .adoc[]
4242
4343include::int128/examples.adoc[]
4444
Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ Listed by analogous STL header.
7272- <<sat_arith, `mul_sat`>>
7373- <<sat_arith, `div_sat`>>
7474- <<saturating_cast, `saturate_cast`>>
75+ - <<gcd, `gcd`>>
76+ - <<lcm, `lcm`>>
7577
7678== Enums
7779
Original file line number Diff line number Diff line change @@ -64,4 +64,42 @@ constexpr TargetIntegerType saturate_cast(LibraryIntegerType x) noexcept;
6464} // namespace boost
6565----
6666
67+ [#gcd]
68+ == Greatest Common Divisor (GCD)
6769
70+ Computes the greatest common divisor of `a` and `b` .
71+
72+ [source, c++]
73+ ----
74+ #include <boost/int128/numeric.hpp>
75+
76+ namespace boost {
77+ namespace int128 {
78+
79+ constexpr uint128_t gcd(uint128_t a, uint128_t b) noexcept;
80+ constexpr uint128_t gcd(const int128_t a, const int128_t b) noexcept;
81+
82+ } // namespace int128
83+ } // namespace boost
84+
85+ ----
86+
87+ [#lcm]
88+ == Least Common Multiple (LCM)
89+
90+ Computes the least common multiple of `a` and `b` .
91+
92+ [source, c++]
93+ ----
94+ #include <boost/int128/numeric.hpp>
95+
96+ namespace boost {
97+ namespace int128 {
98+
99+ constexpr uint128_t lcm(uint128_t a, uint128_t b) noexcept;
100+ constexpr uint128_t lcm(const int128_t a, const int128_t b) noexcept;
101+
102+ } // namespace int128
103+ } // namespace boost
104+
105+ ----
You can’t perform that action at this time.
0 commit comments