The greatest common divisor is the largest non-negative integer that divides every input. The least common multiple is the smallest non-negative common multiple under the stated zero convention. They answer opposite divisibility questions and should not be interchanged.

GCD looks downward to shared factors

For 12 and 18, the positive common divisors are 1, 2, 3 and 6, so the GCD is 6. Euclid reaches the same answer without enumerating every factor, which keeps large exact integers practical.

LCM looks upward to shared multiples

For the same pair, 36 is the first positive value divisible by both 12 and 18. The identity lcm(a,b)=abs((a/gcd(a,b))×b) calculates it exactly while dividing before multiplication.

Verify the arithmetic and its context

GCDLCM checks divisibility identities before returning a result, but an exact arithmetic answer does not prove that a real-world plan, interval, component, structure, dose, route, machine, or safety decision is suitable. Reproduce important results independently and apply only the rules of the neutral integer problem you actually intend to solve.