gcd_division: Calculates the Greatest Common Divisor using the Euclidean...

Description Usage Arguments Value References Examples

Description

The Euclidean division implementation of the greatest common divisor algorithm computes a quotient q_k and a remainder r_k at each step k from the two numbers a and b. The quotient component of Euclidean division is not used in the algorithm, thus only modulo operations are required as that only returns the remainder.

Usage

1

Arguments

a

First integer

b

Second integer

Value

The greatest common divisor

References

Cormen, T., Leiserson, C., Rivest, R., & Stein, C. (2009). Introduction to algorithms (3rd ed., pp. 928-930). Cambridge (Inglaterra): Mit Press. Euclidean algorithm. (2017, May 18). In Wikipedia, The Free Encyclopedia. From https://en.wikipedia.org/w/index.php?title=Euclidean_algorithm&oldid=780973502 Euclidean division. (2017, May 10). In Wikipedia, The Free Encyclopedia. From https://en.wikipedia.org/w/index.php?title=Euclidean_division&oldid=779699188

Examples

1
2
gcd_division(30, 15)
gcd_division(24, 8)

aschleg/numberr documentation built on May 14, 2019, 10:31 a.m.