lcm

fun lcm(a: Int, b: Int): Long

Returns the least common multiple of a and b as a Long.

Signs are ignored and the result is never negative. Returns 0L when either argument is zero. The result always fits because the magnitude of an Int product never exceeds 2^62, so this overload never throws.


fun lcm(a: Long, b: Long): Long

Returns the least common multiple of a and b.

Signs are ignored and the result is never negative. Returns 0L when either argument is zero. Throws ArithmeticException when the result does not fit in Long.