Guest User

Untitled

a guest
Feb 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. (define (fast-expt b n)
  2. (define (iter a b count)
  3. (cond ((= count 0) a)
  4. ((even? count) (iter a (square b) (/ count 2)))
  5. (else (iter (* a b) b (- count 1)))))
  6. (iter 1 b n))
Add Comment
Please, Sign In to add comment