gcd(a, b): while b != 0: a, b = b, a % b return a code example
Example: gcd algorithm
function gcd(a, b)
if b = 0
return a
else
return gcd(b, a mod b)
function gcd(a, b)
if b = 0
return a
else
return gcd(b, a mod b)