aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/calc/calc-ext.el27
1 files changed, 19 insertions, 8 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index bd85bee7dc1..40aae3e47ee 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -1878,8 +1878,19 @@ calc-kill calc-kill-region calc-yank))))
1878 (last-prec (intern (concat (symbol-name name) "-last-prec"))) 1878 (last-prec (intern (concat (symbol-name name) "-last-prec")))
1879 (last-val (intern (concat (symbol-name name) "-last")))) 1879 (last-val (intern (concat (symbol-name name) "-last"))))
1880 (list 'progn 1880 (list 'progn
1881 (list 'defvar cache-prec (if init (math-numdigs (nth 1 init)) -100)) 1881; (list 'defvar cache-prec (if init (math-numdigs (nth 1 init)) -100))
1882 (list 'defvar cache-val (list 'quote init)) 1882 (list 'defvar cache-prec
1883 `(cond
1884 ((consp ,init) (math-numdigs (nth 1 ,init)))
1885 (,init
1886 (nth 1 (math-numdigs (eval ,init))))
1887 (t
1888 -100)))
1889 (list 'defvar cache-val
1890 `(cond
1891 ((consp ,init) ,init)
1892 (,init (eval ,init))
1893 (t ,init)))
1883 (list 'defvar last-prec -100) 1894 (list 'defvar last-prec -100)
1884 (list 'defvar last-val nil) 1895 (list 'defvar last-val nil)
1885 (list 'setq 'math-cache-list 1896 (list 'setq 'math-cache-list
@@ -1914,7 +1925,7 @@ calc-kill calc-kill-region calc-yank))))
1914(put 'math-defcache 'lisp-indent-hook 2) 1925(put 'math-defcache 'lisp-indent-hook 2)
1915 1926
1916;;; Betcha didn't know that pi = 16 atan(1/5) - 4 atan(1/239). [F] [Public] 1927;;; Betcha didn't know that pi = 16 atan(1/5) - 4 atan(1/239). [F] [Public]
1917(math-defcache math-pi (float (bigpos 463 238 793 589 653 592 141 3) -21) 1928(math-defcache math-pi (math-read-number-simple "3.141592653589793238463")
1918 (math-add-float (math-mul-float '(float 16 0) 1929 (math-add-float (math-mul-float '(float 16 0)
1919 (math-arctan-raw '(float 2 -1))) 1930 (math-arctan-raw '(float 2 -1)))
1920 (math-mul-float '(float -4 0) 1931 (math-mul-float '(float -4 0)
@@ -1945,7 +1956,8 @@ calc-kill calc-kill-region calc-yank))))
1945(math-defcache math-sqrt-two-pi nil 1956(math-defcache math-sqrt-two-pi nil
1946 (math-sqrt-float (math-two-pi))) 1957 (math-sqrt-float (math-two-pi)))
1947 1958
1948(math-defcache math-sqrt-e (float (bigpos 849 146 128 700 270 721 648 1) -21) 1959
1960(math-defcache math-sqrt-e (math-read-number-simple "1.648721270700128146849")
1949 (math-add-float '(float 1 0) (math-exp-minus-1-raw '(float 5 -1)))) 1961 (math-add-float '(float 1 0) (math-exp-minus-1-raw '(float 5 -1))))
1950 1962
1951(math-defcache math-e nil 1963(math-defcache math-e nil
@@ -1955,10 +1967,9 @@ calc-kill calc-kill-region calc-yank))))
1955 (math-mul-float (math-add-float (math-sqrt-raw '(float 5 0)) '(float 1 0)) 1967 (math-mul-float (math-add-float (math-sqrt-raw '(float 5 0)) '(float 1 0))
1956 '(float 5 -1))) 1968 '(float 5 -1)))
1957 1969
1958(math-defcache math-gamma-const nil 1970(math-defcache math-gamma-const nil
1959 '(float (bigpos 495 467 917 632 470 369 709 646 776 267 677 848 348 672 1971 (math-read-number-simple
1960 057 988 235 399 359 593 421 310 024 824 900 120 065 606 1972 "0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495"))
1961 328 015 649 156 772 5) -100))
1962 1973
1963(defun math-half-circle (symb) 1974(defun math-half-circle (symb)
1964 (if (eq calc-angle-mode 'rad) 1975 (if (eq calc-angle-mode 'rad)