Skip to content

Instantly share code, notes, and snippets.

@kunishi
Created July 2, 2012 07:47
Show Gist options
  • Save kunishi/3031737 to your computer and use it in GitHub Desktop.
Save kunishi/3031737 to your computer and use it in GitHub Desktop.
factorial
fun factorial n =
let
fun fact1 1 result = result
| fact1 n result = fact1 (n-1) (n * result)
in
fact1 n 1
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment