Created
October 19, 2016 14:55
-
-
Save karakfa/40372466c7e676b60d549d53d98523e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Knuth's way | |
-- from the blog post http://videlalvaro.github.io/2016/10/knuth-first-erlang-programmer.html | |
gcd m n = f m n 0 1 | |
where f m n r 1 = f m n (mod m n) 2 | |
f m n 0 2 = n | |
f m n r 2 = f n r r 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment