Skip to content

Instantly share code, notes, and snippets.

@noxan
Created May 28, 2013 20:27
Show Gist options
  • Save noxan/5665841 to your computer and use it in GitHub Desktop.
Save noxan/5665841 to your computer and use it in GitHub Desktop.
Some erlang learning stuff..
-module(factorial).
-export([factorial/1]).
factorial(N) -> factorial(N, 1).
factorial(0, Acc) -> Acc,
factorial(N, Acc) -> factorial(N-1, N*Acc).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment