Description Usage Arguments Value Examples
Computes the greatest common divisor using the original implementation of the algorithm by Euclid. In this version of the algorithm, the quotient q_k and remainder r_k is calculated by repeated division by subtraction. Therefore, in this implementation of the greatest common divisor algorithm, the modulo operation in the division implementation is replaced by division by repeated subtraction.
1 | gcd_subtraction(a, b)
|
a |
First integer |
b |
Second integer |
The greatest common divisor
1 2 | gcd_subtraction(21, 6)
gcd_subtraction(25, 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.