RosettaCodeData/Task/Factorial/XLISP/factorial.l

7 lines
95 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
(defun factorial (x)
(if (< x 0)
nil
(if (<= x 1)
1
(* x (factorial (- x 1))) ) ) )