From e41fe7ced52fca41f3968b97df9572e4011025de Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 18 Feb 2017 05:13:20 +0000 Subject: net: Fix `fast-*` function. * net/ricketyspace/sicp/one/seventeen.scm (fast-*): Update function. --- net/ricketyspace/sicp/one/seventeen.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/ricketyspace') 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)))))) -- cgit v1.2.3