diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:26 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:26 -0800 |
commit | f24b9140d6f74804d5599ec225717d38ca443813 (patch) | |
tree | 0da952f1a5a7c0eacfc05c296766523e32c05fe2 /factor.scm | |
parent | 8ffbc2df0fde83082610149d24e594c1cd879f4a (diff) | |
download | slib-f24b9140d6f74804d5599ec225717d38ca443813.tar.gz slib-f24b9140d6f74804d5599ec225717d38ca443813.zip |
Import Upstream version 2c0upstream/2c0
Diffstat (limited to 'factor.scm')
-rw-r--r-- | factor.scm | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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) |