Skip to content

Instantly share code, notes, and snippets.

@ceme
Created June 19, 2015 22:15
Show Gist options
  • Save ceme/47b5e32eb43ee541f85b to your computer and use it in GitHub Desktop.
Save ceme/47b5e32eb43ee541f85b to your computer and use it in GitHub Desktop.
Euclidean algorithm implemented in JavaScript - demo: http://jsfiddle.net/86znwp1y/
function gcd(a, b) {
return c = (b == 0) ? a : gcd (b, a % b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment