Function lcm

  • Least common multiple of two integers.

    Return zero if either of the arguments is zero.

    Satisfies a * b = gcd * lcm. See gcd for consequences on negative inputs.

    Parameters

    • a: number

      The first integer.

    • b: number

      The second integer.

    Returns number

    The smallest integer that both a and b divide.

  • Parameters

    • a: bigint
    • b: bigint

    Returns bigint