23
Algorithms library
[algorithms]
23.9
Generalized numeric operations
[numeric.ops]
23.9.13
Least common multiple
[numeric.ops.lcm]
ðŸ”—
template
<
class
M,
class
N
>
constexpr
common_type_t
<
M,N
>
lcm
(
M m, N n
)
;
1
#
Requires:

m

and

n

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

m

and

n

shall be representable as a value of type
common_type_t
<
M,N
>
.
2
#
Remarks:
If either
M
or
N
is not an integer type, or if either is
cv
bool
the program is illformed
.
3
#
Returns:
Zero when either
m
or
n
is zero
.
Otherwise, returns the least common multiple of

m

and

n

.
4
#
Throws:
Nothing
.