summaryrefslogtreecommitdiffstats
path: root/factor.scm
diff options
context:
space:
mode:
Diffstat (limited to 'factor.scm')
-rw-r--r--factor.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/factor.scm b/factor.scm
index a5d3e8c..6d7b38d 100644
--- a/factor.scm
+++ b/factor.scm
@@ -51,9 +51,11 @@
;;; prime:product is a product of small primes.
(define prime:product
(let ((p 210))
- (for-each (lambda (s) (set! p (or (string->number s) p)))
- '("2310" "30030" "510510" "9699690" "223092870"
- "6469693230" "200560490130"))
+ (for-each (lambda (s)
+ (set! s (string->number s))
+ (set! p (or (and s (exact? s) s) p)))
+ '("2310" "30030" "510510" "9699690" "223092870"
+ "6469693230" "200560490130"))
p))
(define (prime:prime? n)