Skip to content

Instantly share code, notes, and snippets.

@adanselm
Created April 7, 2015 15:41
Show Gist options
  • Save adanselm/829460980bf8c0bb8005 to your computer and use it in GitHub Desktop.
Save adanselm/829460980bf8c0bb8005 to your computer and use it in GitHub Desktop.
Example Erlang function to compute factorials (taken from wikipedia)
-module(fact).
-export([fac/1]).
fac(0) -> 1;
fac(N) when N > 0, is_integer(N) -> N * fac(N-1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment