1.2 KiB
1.2 KiB
[numeric.ops.lcm]
26 Algorithms library [algorithms]
26.10 Generalized numeric operations [numeric.ops]
26.10.15 Least common multiple [numeric.ops.lcm]
template<class M, class N> constexpr common_type_t<M, N> lcm(M m, N n);
Mandates: M and N both are integer types other thancv bool.
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>.
Returns: Zero when either m or n is zero.
Otherwise, returns the least common multiple of |m| and |n|.
Throws: Nothing.