1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* 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.
This commit is contained in:
Jay Belanger 2013-10-16 22:37:05 -05:00
parent bb9937df2d
commit c8722a9799
4 changed files with 26 additions and 7 deletions

View file

@ -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 (%