Skip to content

Instantly share code, notes, and snippets.

@rubenwardy
Created May 22, 2014 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubenwardy/49d3a3c42118718da28b to your computer and use it in GitHub Desktop.
Save rubenwardy/49d3a3c42118718da28b to your computer and use it in GitHub Desktop.
Greatest common divisor
hcf' x y | x > y = hcf' (x-y) y
| x < y = hcf' x (y-x)
| otherwise = x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment