diff options
| author | Jay Belanger | 2007-07-07 23:56:56 +0000 |
|---|---|---|
| committer | Jay Belanger | 2007-07-07 23:56:56 +0000 |
| commit | 4b4b19bdd598a2ba991162829921bc2e7e8d5083 (patch) | |
| tree | b8f8b97481b361537d4a9abfd95cb1ab353da41a | |
| parent | aefad52dcdaea3598788a42674dbc025cf12b3dc (diff) | |
| download | emacs-4b4b19bdd598a2ba991162829921bc2e7e8d5083.tar.gz emacs-4b4b19bdd598a2ba991162829921bc2e7e8d5083.zip | |
(math-small-factorial-table,math-init-random-base,math-prime-test):
Remove unnecessary calls to `math-read-number-simple'.
| -rw-r--r-- | lisp/calc/calc-comb.el | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el index ede04fd5032..c933ecd7e00 100644 --- a/lisp/calc/calc-comb.el +++ b/lisp/calc/calc-comb.el | |||
| @@ -296,9 +296,7 @@ | |||
| 296 | 296 | ||
| 297 | (defconst math-small-factorial-table | 297 | (defconst math-small-factorial-table |
| 298 | (eval-when-compile | 298 | (eval-when-compile |
| 299 | (vector 1 1 2 6 24 120 720 5040 40320 362880 | 299 | (vector 1 1 2 6 24 120 720 5040 40320 362880 3628800 39916800 |
| 300 | (math-read-number-simple "3628800") | ||
| 301 | (math-read-number-simple "39916800") | ||
| 302 | (math-read-number-simple "479001600") | 300 | (math-read-number-simple "479001600") |
| 303 | (math-read-number-simple "6227020800") | 301 | (math-read-number-simple "6227020800") |
| 304 | (math-read-number-simple "87178291200") | 302 | (math-read-number-simple "87178291200") |
| @@ -559,15 +557,9 @@ | |||
| 559 | nil | 557 | nil |
| 560 | (if (Math-integerp var-RandSeed) | 558 | (if (Math-integerp var-RandSeed) |
| 561 | (let* ((seed (math-sub 161803 var-RandSeed)) | 559 | (let* ((seed (math-sub 161803 var-RandSeed)) |
| 562 | (mj (1+ (math-mod seed | 560 | (mj (1+ (math-mod seed 1000000))) |
| 563 | (eval-when-compile | 561 | (mk (1+ (math-mod (math-quotient seed 1000000) |
| 564 | (math-read-number-simple "1000000"))))) | 562 | 1000000))) |
| 565 | (mk (1+ (math-mod (math-quotient | ||
| 566 | seed | ||
| 567 | (eval-when-compile | ||
| 568 | (math-read-number-simple "1000000"))) | ||
| 569 | (eval-when-compile | ||
| 570 | (math-read-number-simple "1000000"))))) | ||
| 571 | (i 0)) | 563 | (i 0)) |
| 572 | (setq math-random-table (cons 'vec (make-list 55 mj))) | 564 | (setq math-random-table (cons 'vec (make-list 55 mj))) |
| 573 | (while (<= (setq i (1+ i)) 54) | 565 | (while (<= (setq i (1+ i)) 54) |
| @@ -817,9 +809,7 @@ | |||
| 817 | (error "Argument must be an integer")) | 809 | (error "Argument must be an integer")) |
| 818 | ((Math-integer-negp n) | 810 | ((Math-integer-negp n) |
| 819 | '(nil)) | 811 | '(nil)) |
| 820 | ((Math-natnum-lessp n | 812 | ((Math-natnum-lessp n 8000000) |
| 821 | (eval-when-compile | ||
| 822 | (math-read-number-simple "8000000"))) | ||
| 823 | (setq n (math-fixnum n)) | 813 | (setq n (math-fixnum n)) |
| 824 | (let ((i -1) v) | 814 | (let ((i -1) v) |
| 825 | (while (and (> (% n (setq v (aref math-primes-table | 815 | (while (and (> (% n (setq v (aref math-primes-table |
| @@ -838,17 +828,11 @@ | |||
| 838 | (+ | 828 | (+ |
| 839 | sum | 829 | sum |
| 840 | (calcFunc-mod | 830 | (calcFunc-mod |
| 841 | q | 831 | q 1000000)) |
| 842 | (eval-when-compile | ||
| 843 | (math-read-number-simple | ||
| 844 | "1000000")))) | ||
| 845 | 111111)) | 832 | 111111)) |
| 846 | (setq q | 833 | (setq q |
| 847 | (math-quotient | 834 | (math-quotient |
| 848 | q | 835 | q 1000000))) |
| 849 | (eval-when-compile | ||
| 850 | (math-read-number-simple | ||
| 851 | "1000000"))))) | ||
| 852 | (cond ((= (% sum 3) 0) '(nil 3)) | 836 | (cond ((= (% sum 3) 0) '(nil 3)) |
| 853 | ((= (% sum 7) 0) '(nil 7)) | 837 | ((= (% sum 7) 0) '(nil 7)) |
| 854 | ((= (% sum 11) 0) '(nil 11)) | 838 | ((= (% sum 11) 0) '(nil 11)) |