PGCD
Un algorithme permettant de déterminer le plus grand commun diviseur (PGCD) de deux entiers sans connaître leur factorisation. - Euclide (-300 bc) / Algorithm
pseudo code
function gcd(a, b)
while b ≠ 0
t := b;
b := a mod b;
a := t;
return a;
or
function gcd(a, b)
if b = 0
return a;
else
return gcd(b, a mod b);
Written on March 18, 2018, Last update on March 30, 2021
math
algorithm