Skip to content

Commit 13caa4f

Browse files
committed
Add gcd and lcm to docs
1 parent 46850cd commit 13caa4f

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

doc/int128.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ include::int128/charconv.adoc[]
3838

3939
include::int128/stream.adoc[]
4040

41-
include::int128/saturating.adoc[]
41+
include::int128/numeric.adoc[]
4242

4343
include::int128/examples.adoc[]
4444

doc/int128/api_reference.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
----

0 commit comments

Comments
 (0)