The Euclidean algorithm calculates the greatest common divisor (GCD) of two natural numbers "a" and "b". The greatest common divisor "g" is the largest natural number that divides both "a" and "b" without leaving a remainder. Synonyms for the GCD include the "greatest common factor" (GCF), the "highest common factor" (HCF), the "highest common divisor" (HCD), and the "greatest common measure" (GCM). The greatest common divisor is often written as gcd("a", "b") or, more simply, as ("a", "b"), although the latter notation is ambiguous, also used for concepts such as an ideal in the ring of integers, which is closely related to GCD.