Skip to content

Instantly share code, notes, and snippets.

@vmencik
Created January 17, 2013 08:49
Show Gist options
  • Save vmencik/4554631 to your computer and use it in GitHub Desktop.
Save vmencik/4554631 to your computer and use it in GitHub Desktop.
@tailrec
def gcd(a: Int, b: Int): Int =
if (b == 0) a else gcd(b, a % b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment