previous | index | next

Iterative Procedure for power

(define power
  (lambda (b e)

    (define power-product
      (lambda (a b e)
        (if (= e 0)
            a
            (power-product (* a b) b (- e 1)))))

    (power-product 1 b e)))

previous | index | next