The euclidean algorithm computes the greatest common divisor of two integers by repeated division with remainder. Start with , , interchanging them if necessary, and repeatedly writeuntil a zero remainder occurs. The positive remainders strictly decrease, so the process terminates. At each step the common divisors of are exactly the common divisors of , because . HenceIf one input is zero, the answer is the absolute value of the other; the usual convention sets . Back-substitution also expresses the greatest common divisor as an integer linear combination of the inputs, as in Bézout's identity.
Articles by others on the same topic
There are currently no matching articles.