Skip to content

Instantly share code, notes, and snippets.

@jmercouris
Created July 27, 2018 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmercouris/e1138150f0a808c7f540c8260a480eb2 to your computer and use it in GitHub Desktop.
Save jmercouris/e1138150f0a808c7f540c8260a480eb2 to your computer and use it in GitHub Desktop.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; FUNCTION
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun fact (n)
(cond ((zerop n) 1)
(t (* n (fact (- n 1))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; REPL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CL-USER> (fact 20.0)
2.432902e18
CL-USER> (fact 20)
2432902008176640000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment