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

5 lines
89 B
Common Lisp
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
(defun my-expt-rec (a b)
(cond
((= b 0) 1)
(t (* a (my-expt-rec a (- b 1))))))