emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 891bbec 2/3: Simplify big integer constants in Calc


From: Mattias Engdegård
Subject: master 891bbec 2/3: Simplify big integer constants in Calc
Date: Fri, 11 Sep 2020 07:15:02 -0400 (EDT)

branch: master
commit 891bbec2e09986f6ef562f2172cd349e9f55cbe8
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    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.
---
 lisp/calc/calc-comb.el  | 12 +++---------
 lisp/calc/calc-funcs.el | 14 +++++++-------
 lisp/calc/calc.el       |  6 ++----
 3 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el
index c5d4d08..2efeb7f 100644
--- a/lisp/calc/calc-comb.el
+++ b/lisp/calc/calc-comb.el
@@ -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)
diff --git a/lisp/calc/calc-funcs.el b/lisp/calc/calc-funcs.el
index add39b6..14f5e32 100644
--- a/lisp/calc/calc-funcs.el
+++ b/lisp/calc/calc-funcs.el
@@ -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)
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 90789a6..bf8b006 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]