qse/ase/test/lsp/t5.lsp

8 lines
160 B
Common Lisp

; Compute the N'th Fibonacci number.
(defun fibonacci (N)
(if (or (zerop N) (= N 1))
1
(+ (fibonacci (- N 1)) (fibonacci (- N 2)))))
(fibonacci 5)