Skip to content

Instantly share code, notes, and snippets.

@dchiji
Created July 15, 2009 06:15
Show Gist options
  • Save dchiji/147511 to your computer and use it in GitHub Desktop.
Save dchiji/147511 to your computer and use it in GitHub Desktop.
-module(euclidean).
-export([euclidean/2]).
euclidean(M, 0) -> M;
euclidean(M, N) when M rem N == 0 -> N;
euclidean(M, N) -> euclidean(N, M rem N).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment