diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ricketyspace/sicp/one/sixteen.scm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ricketyspace/sicp/one/sixteen.scm b/net/ricketyspace/sicp/one/sixteen.scm index 8bbd735..60bc531 100644 --- a/net/ricketyspace/sicp/one/sixteen.scm +++ b/net/ricketyspace/sicp/one/sixteen.scm @@ -22,5 +22,5 @@ (define (fast-expt-iter b n a) "Excercise 1.16." (cond ((= n 0) a) - ((even? n) (fast-expt-iter b (- n 2) (* a (sqr b)))) + ((even? n) (fast-expt-iter (sqr b) (/ n 2) a)) (else (fast-expt-iter b (- n 1) (* a b))))) |