File: fib.lsp

package info (click to toggle)
xlispstat 3.52.14-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 7,560 kB
  • ctags: 12,676
  • sloc: ansic: 91,357; lisp: 21,759; sh: 1,525; makefile: 521; csh: 1
file content (10 lines) | stat: -rw-r--r-- 202 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
(defun fib (x)
       (if (< x 2)
           x
           (+ (fib (1- x)) (fib (- x 2)))))

(defun fibi (n)
	(do	((i 1 (1+ i))
		 (fib-i-1 0 fib-i)
		 (fib-i   1 (+ fib-i fib-i-1)))
		((= i n) fib-i)))