RosettaCodeData/Task/Exponentiation-operator/Common-Lisp/exponentiation-operator-2.lisp

5 lines
89 B
Common Lisp

(defun my-expt-rec (a b)
(cond
((= b 0) 1)
(t (* a (my-expt-rec a (- b 1))))))