expt

Name

expt -- Exponentiation

Synopsis

(expt b n)

Description

Returns b raised to the nth power for integer n >= 0.

Author

Norman Walsh, <ndw@nwalsh.com>

Source Code

(define (expt b n)
  ;; Exponentiation
  ;; 
  (if (<= n 0)
      1
      (* b (expt b (- n 1)))))