Skip to content

Instantly share code, notes, and snippets.

@ccarvalho-eng
Created June 6, 2022 12:01
Show Gist options
  • Save ccarvalho-eng/4de65b2f3db4f3846ca2e8daa80e4634 to your computer and use it in GitHub Desktop.
Save ccarvalho-eng/4de65b2f3db4f3846ca2e8daa80e4634 to your computer and use it in GitHub Desktop.
```erlang
-module(fact).
% fact module
-export([run/1]).
-spec run(integer()) -> integer().
run(N) when N > 0 ->
N * run(N-1);
run(0) ->
1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment