math.lisp 178 B

1234567891011
  1. ;; Math Functions
  2. (defun zero? (n)
  3. (= 0 n))
  4. (defun ! (x)
  5. (let ((total 1))
  6. (dotimes (i (1+ x))
  7. (when (not (zero? i))
  8. (setf total (* i total))))
  9. total))