summaryrefslogtreecommitdiffstats
path: root/factor.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:26 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:26 -0800
commitf24b9140d6f74804d5599ec225717d38ca443813 (patch)
tree0da952f1a5a7c0eacfc05c296766523e32c05fe2 /factor.scm
parent8ffbc2df0fde83082610149d24e594c1cd879f4a (diff)
downloadslib-f24b9140d6f74804d5599ec225717d38ca443813.tar.gz
slib-f24b9140d6f74804d5599ec225717d38ca443813.zip
Import Upstream version 2c0upstream/2c0
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)