summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2017-02-18 05:13:20 +0000
committerrsiddharth <s@ricketyspace.net>2017-02-18 05:13:20 +0000
commite41fe7ced52fca41f3968b97df9572e4011025de (patch)
tree2b6cd276f5df263e4ab78a6f401daf927529e9df /net
parent884d25827772806000fc640aa339a5190704e8ac (diff)
net: Fix `fast-*` function.
* net/ricketyspace/sicp/one/seventeen.scm (fast-*): Update function.
Diffstat (limited to 'net')
-rw-r--r--net/ricketyspace/sicp/one/seventeen.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ricketyspace/sicp/one/seventeen.scm b/net/ricketyspace/sicp/one/seventeen.scm
index 1a5ec15..48717e9 100644
--- a/net/ricketyspace/sicp/one/seventeen.scm
+++ b/net/ricketyspace/sicp/one/seventeen.scm
@@ -41,6 +41,6 @@ B must be an even number."
(define (fast-* a b)
"Return A * B."
- (cond ((= b 1) a)
+ (cond ((= b 0) 0)
((even? b) (double (fast-* a (halve b))))
(else (+ a (fast-* a (- b 1))))))