ExtendedGCD
The GCD of a and b together with Bézout coefficients x, y such that a·x + b·y = GCD(a, b).
Wikipedia
Extended Euclidean algorithmWikidataQ1362750Wolfram LanguageExtendedGCD!Rosetta CodeModular inverseExtendedGCD(a, b)Details
- Implements the extended Euclidean algorithm, the standard way to compute modular inverses. See PowerMod.
- The coefficients
are not unique; the algorithm returns one particular solution pair. - When
, the coefficients reduce to . - compute-engine only accepts two.
Examples
See also: GCD