The least common multiple is useful when adding or subtracting fractions, because it yields the lowest common denominator. Consider for instance
In case not both a and b are zero, the least common multiple can be computed by using the greatest common divisor (or GCD) of a and b,
a b | |
lcm(a, b) = | --------- |
gcd(a, b) |
Thus, the Euclidean algorithm for the GCD also gives us a fast algorithm for the LCM. As an example, the LCM of 12 and 15 is 12 × 15 / 3 = 60.