1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-06 07:31:13 -08:00

Simplify big integer constants in Calc

* lisp/calc/calc-comb.el (math-small-factorial-table):
* lisp/calc/calc-funcs.el (math-bernoulli-b-cache):
* lisp/calc/calc.el (math-2-word-size, math-half-2-word-size):
No need for math-read-number-simple.
This commit is contained in:
Mattias Engdegård 2020-09-11 13:02:59 +02:00
parent b5fe447480
commit 891bbec2e0
3 changed files with 12 additions and 20 deletions

View file

@ -292,15 +292,9 @@
(defconst math-small-factorial-table
(vector 1 1 2 6 24 120 720 5040 40320 362880 3628800 39916800
(math-read-number-simple "479001600")
(math-read-number-simple "6227020800")
(math-read-number-simple "87178291200")
(math-read-number-simple "1307674368000")
(math-read-number-simple "20922789888000")
(math-read-number-simple "355687428096000")
(math-read-number-simple "6402373705728000")
(math-read-number-simple "121645100408832000")
(math-read-number-simple "2432902008176640000")))
479001600 6227020800 87178291200 1307674368000 20922789888000
355687428096000 6402373705728000 121645100408832000
2432902008176640000))
(defun calcFunc-fact (n) ; [I I] [F F] [Public]
(let (temp)

View file

@ -816,25 +816,25 @@
(list
(list 'frac
-174611
(math-read-number-simple "802857662698291200000"))
802857662698291200000)
(list 'frac
43867
(math-read-number-simple "5109094217170944000"))
5109094217170944000)
(list 'frac
-3617
(math-read-number-simple "10670622842880000"))
10670622842880000)
(list 'frac
1
(math-read-number-simple "74724249600"))
74724249600)
(list 'frac
-691
(math-read-number-simple "1307674368000"))
1307674368000)
(list 'frac
1
(math-read-number-simple "47900160"))
47900160)
(list 'frac
-1
(math-read-number-simple "1209600"))
1209600)
(list 'frac
1
30240)

View file

@ -3452,12 +3452,10 @@ See Info node `(calc)Defining Functions'."
(defun calc-clear-unread-commands ()
(setq unread-command-events nil))
(defcalcmodevar math-2-word-size
(math-read-number-simple "4294967296")
(defcalcmodevar math-2-word-size 4294967296
"Two to the power of `calc-word-size'.")
(defcalcmodevar math-half-2-word-size
(math-read-number-simple "2147483648")
(defcalcmodevar math-half-2-word-size 2147483648
"One-half of two to the power of `calc-word-size'.")
(when calc-always-load-extensions