Skip to content

Instantly share code, notes, and snippets.

@jazzyF
Created May 23, 2020 08:45
Show Gist options
  • Save jazzyF/6ef17a2f9c7946aed9063315023bcc4c to your computer and use it in GitHub Desktop.
Save jazzyF/6ef17a2f9c7946aed9063315023bcc4c to your computer and use it in GitHub Desktop.
-module(fib).
-export([fib/1]).
fib(0) ->
0;
fib(1) ->
1;
fib(N) when N > 1 ->
fib(N-2) + fib(N-1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment