Extended Euclidean algorithm for integers a and b: Find x and y such that ax + by = gcd(a, b).
result.gcd = a * result.coefA + b * result.coefB; // = gcd(a, b)result.quotientA = div(a, gcd(a, b));result.quotientB = div(b, gcd(a, b)); Copy
result.gcd = a * result.coefA + b * result.coefB; // = gcd(a, b)result.quotientA = div(a, gcd(a, b));result.quotientB = div(b, gcd(a, b));
The first integer.
The second integer.
Bézout coefficients, gcd and quotients.
Extended Euclidean algorithm for integers a and b: Find x and y such that ax + by = gcd(a, b).