pub fn extended_euclidean_algorithm(a: i64, b: i64) -> (i64, i64, i64)
Expand description
Computes the greatest common divisor of 2 natural numbers and 2 additional numbers such that gcd(a,b)=s·a+t·b holds.
§Examples
let a = 27;
let b = 5;
let (gcd, s, t) = mathematics::extended_euclidean_algorithm(a, b);
assert_eq!(gcd,5);
assert_eq!(s, 1);
assert_eq!(t, -4);