Skip to main content

function

lcm

lcm(a: Int, b: Int) -> Int

Computes the least common multiple of two integers.

Args:

  • a (Int): The first input argument. Must be non-negative.
  • b (Int): The second input argument. Must be non-negative.

Returns:

The least common multiple of the inputs. Results are undefined if either input is negative.

Was this page helpful?