RosettaCodeData/Task/Factorial/XLISP/factorial.xlisp

7 lines
95 B
Text
Raw Permalink Normal View History

2017-09-23 10:01:46 +02:00
(defun factorial (x)
(if (< x 0)
nil
(if (<= x 1)
1
(* x (factorial (- x 1))) ) ) )