Skip to content

Instantly share code, notes, and snippets.

@mamonu
Created June 11, 2015 16:15
Show Gist options
  • Select an option

  • Save mamonu/e4aad333a04ac6052651 to your computer and use it in GitHub Desktop.

Select an option

Save mamonu/e4aad333a04ac6052651 to your computer and use it in GitHub Desktop.
find greatest common denominator with Euclidean algorithm
def gcd(u, v):
return gcd(v, u % v) if v else abs(u)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment