summaryrefslogtreecommitdiff
path: root/sample/fib.scm
blob: 8eba75bb9e3da6a3c5870be6b5f5790e0298ba78 (plain)
1
2
3
4
5
6
(define (fib n)
  (if (< n 2)
      n
      (+ (fib (- n 2)) (fib (- n 1)))))

(fib 20)