RosettaCodeData/Task/Exponentiation-operator/Common-Lisp/exponentiation-operator-2.lisp
2023-07-01 13:44:08 -04:00

4 lines
89 B
Common Lisp

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