summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-comb.el
diff options
context:
space:
mode:
authorJay Belanger <jay.p.belanger@gmail.com>2013-10-16 22:37:05 -0500
committerJay Belanger <jay.p.belanger@gmail.com>2013-10-16 22:37:05 -0500
commitc8722a9799832942ff219f4ae881f44985c35924 (patch)
tree531d2d7e5bc2b815906b86d5aab50aee1f7ae6df /lisp/calc/calc-comb.el
parentbb9937df2db9129cdc248532a93f406221a2f65c (diff)
downloademacs-c8722a9799832942ff219f4ae881f44985c35924.tar.gz
emacs-c8722a9799832942ff219f4ae881f44985c35924.tar.bz2
emacs-c8722a9799832942ff219f4ae881f44985c35924.zip
* calc/calc-comb.el (math-prime-test): Don't assume large integers are
represented by lists. * doc/misc/calc.el (Data Type Formats): Don't specify the size at which integers begin to be represented by lists.
Diffstat (limited to 'lisp/calc/calc-comb.el')
-rw-r--r--lisp/calc/calc-comb.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el
index e09bef0b5c9..1a2d6092196 100644
--- a/lisp/calc/calc-comb.el
+++ b/lisp/calc/calc-comb.el
@@ -815,8 +815,14 @@
(list nil v)
'(t))))
((not (equal n (car math-prime-test-cache)))
- (cond ((= (% (nth 1 n) 2) 0) '(nil 2))
- ((= (% (nth 1 n) 5) 0) '(nil 5))
+ (cond ((if (consp n)
+ (= (% (nth 1 n) 2) 0)
+ (= (% n 2) 0))
+ '(nil 2))
+ ((if (consp n)
+ (= (% (nth 1 n) 5) 0)
+ (= (% n 5) 0))
+ '(nil 5))
(t (let ((q n) (sum 0))
(while (not (eq q 0))
(setq sum (%