25
Algorithms library
[algorithms]
25.10
Generalized numeric operations
[numeric.ops]
25.10.14
Least common multiple
[numeric.ops.lcm]
ðŸ”—
template
<
class
M,
class
N
>
constexpr
common_type_t
<
M,N
>
lcm
(
M m, N n
)
;
1
#
Mandates:
M
and
N
both are integer types and not
cv
bool
.
2
#
Preconditions:

m

and

n

are representable as a value of
common_type_t
<
M, N
>
.
The least common multiple of

m

and

n

is representable as a value of type
common_type_t
<
M,N
>
.
3
#
Returns:
Zero when either
m
or
n
is zero
.
Otherwise, returns the least common multiple of

m

and

n

.
4
#
Throws:
Nothing
.