xgcd
xgcd(a, b)
Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.
Try it yourself:
$1 | xgcd(8, 12)
| |
$2 | gcd(8, 12)
| |
$3 | xgcd(36163, 21199)
|