transcendental-lisp/fact.lisp

4 lines
71 B
Common Lisp
Raw Normal View History

2016-12-07 14:16:45 -05:00
(defun fact (x)
(cond ((> 2 x) 1)
(t (* x (fact (- x 1))))))