Description Usage Arguments Value References Examples
The extended Euclidean algorithm computes the greatest common divisor, d of two integers a and b as well as the coefficients x and y such that:
d = gcd(a, b) = ax + by
The coefficients x and y are known as Bezout's coefficients and can be zero or negative.
1 | gcd_extended(a, b)
|
a |
First integer |
b |
Second integer |
vector containing coefficients (d, x, y)
Bezout's identity. (2017, May 12). In Wikipedia, The Free Encyclopedia. From https://en.wikipedia.org/w/index.php?title=B Cormen, T., Leiserson, C., Rivest, R., & Stein, C. (2009). Introduction to algorithms (3rd ed., pp. 937-938). Cambridge (Inglaterra): Mit Press.
1 2 | gcd_extended(99, 78)
gcd_extended(55, 45)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.