]> git.eshelyaron.com Git - emacs.git/commitdiff
Simplify big integer constants in Calc
authorMattias Engdegård <mattiase@acm.org>
Fri, 11 Sep 2020 11:02:59 +0000 (13:02 +0200)
committerMattias Engdegård <mattiase@acm.org>
Fri, 11 Sep 2020 11:02:59 +0000 (13:02 +0200)
* 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.

lisp/calc/calc-comb.el
lisp/calc/calc-funcs.el
lisp/calc/calc.el

index c5d4d0837e7a6eb08d627e1883c6afe70c575585..2efeb7f0f22653611926c199fc0bd84d9d9f66a4 100644 (file)
 
 (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)
index add39b6f8b98de1ca0bb55f50b038714aa540041..14f5e3210801dffa967720ef311ee45928fecdef 100644 (file)
   (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)
index 90789a69cd1bfa85002a074f0a85b35d631933ef..bf8b006d7c65c8abe6d0211ffd6704cbd9d97374 100644 (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