Skip to content

Instantly share code, notes, and snippets.

@dkinzer
Created November 14, 2014 16:23
Show Gist options
  • Save dkinzer/e22f438a39df306b34a8 to your computer and use it in GitHub Desktop.
Save dkinzer/e22f438a39df306b34a8 to your computer and use it in GitHub Desktop.
Algorithms in JavaScript.
// Euclid's algorithm to determine greatest common divisor.
function E_1_1 (m, n) {
var r = m % n;
if (r == 0) {
return n;
}
return E_1_1(n, r);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment