The OpenD Programming Language

lcm

Computes the least common multiple of a and b. Arguments are the same as gcd.

  1. typeof(Unqual!(T).init % Unqual!(U).init) lcm(T a, U b)
    typeof(Unqual!(T).init % Unqual!(U).init)
    lcm
    (
    T
    U
    )
    (
    T a
    ,
    U b
    )
  2. auto lcm(T a, T b)

Return Value

Type: typeof(Unqual!(T).init % Unqual!(U).init)

The least common multiple of the given arguments.

Examples

assert(lcm(1, 2) == 2);
assert(lcm(3, 4) == 12);
assert(lcm(5, 6) == 30);

Meta