~statianzo/sevenlangs

ref: 9127ef127308c3562baebc277dda2b7e942cacd8 sevenlangs/erlang/fib.erl -rw-r--r-- 152 bytes
9127ef12Jason Staten fib 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
-module(fib).
-export([fibr/1]).


fibr(N) -> fibloop(N, 1, 1).

fibloop(0, A, _) -> A;
fibloop(1, _, B) -> B;
fibloop(N, A, B) -> fibloop(N-1, B, A+B).