diff options
| author | Jay Belanger | 2013-10-16 22:37:05 -0500 |
|---|---|---|
| committer | Jay Belanger | 2013-10-16 22:37:05 -0500 |
| commit | c8722a9799832942ff219f4ae881f44985c35924 (patch) | |
| tree | 531d2d7e5bc2b815906b86d5aab50aee1f7ae6df /lisp | |
| parent | bb9937df2db9129cdc248532a93f406221a2f65c (diff) | |
| download | emacs-c8722a9799832942ff219f4ae881f44985c35924.tar.gz 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')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/calc/calc-comb.el | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 914826db0b5..542a9108d32 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-10-17 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc/calc-comb.el (math-prime-test): Don't assume large integers are | ||
| 4 | represented by lists. | ||
| 5 | |||
| 1 | 2013-10-16 Glenn Morris <rgm@gnu.org> | 6 | 2013-10-16 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * tmm.el (tmm--history): New dynamic variable. | 8 | * tmm.el (tmm--history): New dynamic variable. |
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 @@ | |||
| 815 | (list nil v) | 815 | (list nil v) |
| 816 | '(t)))) | 816 | '(t)))) |
| 817 | ((not (equal n (car math-prime-test-cache))) | 817 | ((not (equal n (car math-prime-test-cache))) |
| 818 | (cond ((= (% (nth 1 n) 2) 0) '(nil 2)) | 818 | (cond ((if (consp n) |
| 819 | ((= (% (nth 1 n) 5) 0) '(nil 5)) | 819 | (= (% (nth 1 n) 2) 0) |
| 820 | (= (% n 2) 0)) | ||
| 821 | '(nil 2)) | ||
| 822 | ((if (consp n) | ||
| 823 | (= (% (nth 1 n) 5) 0) | ||
| 824 | (= (% n 5) 0)) | ||
| 825 | '(nil 5)) | ||
| 820 | (t (let ((q n) (sum 0)) | 826 | (t (let ((q n) (sum 0)) |
| 821 | (while (not (eq q 0)) | 827 | (while (not (eq q 0)) |
| 822 | (setq sum (% | 828 | (setq sum (% |