Mercurial > emacs
comparison lisp/calc/calc-ext.el @ 81743:79a229b4a7de
(math-approx-pi,math-approx-sqrt-e,math-approx-gamma-const):
Add docstrings.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Sat, 07 Jul 2007 23:57:23 +0000 |
parents | c17a6c377cf2 |
children | b98604865ea0 988f1edc9674 |
comparison
equal
deleted
inserted
replaced
81742:3340bf730dea | 81743:79a229b4a7de |
---|---|
1923 last-prec 'calc-internal-prec)) | 1923 last-prec 'calc-internal-prec)) |
1924 last-val)))) | 1924 last-val)))) |
1925 (put 'math-defcache 'lisp-indent-hook 2) | 1925 (put 'math-defcache 'lisp-indent-hook 2) |
1926 | 1926 |
1927 ;;; 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] |
1928 (defconst math-approx-pi | 1928 (defconst math-approx-pi |
1929 (eval-when-compile | 1929 (eval-when-compile |
1930 (math-read-number-simple "3.141592653589793238463"))) | 1930 (math-read-number-simple "3.141592653589793238463")) |
1931 "An approximation for pi.") | |
1932 | |
1931 (math-defcache math-pi math-approx-pi | 1933 (math-defcache math-pi math-approx-pi |
1932 (math-add-float (math-mul-float '(float 16 0) | 1934 (math-add-float (math-mul-float '(float 16 0) |
1933 (math-arctan-raw '(float 2 -1))) | 1935 (math-arctan-raw '(float 2 -1))) |
1934 (math-mul-float '(float -4 0) | 1936 (math-mul-float '(float -4 0) |
1935 (math-arctan-raw | 1937 (math-arctan-raw |
1958 | 1960 |
1959 (math-defcache math-sqrt-two-pi nil | 1961 (math-defcache math-sqrt-two-pi nil |
1960 (math-sqrt-float (math-two-pi))) | 1962 (math-sqrt-float (math-two-pi))) |
1961 | 1963 |
1962 (defconst math-approx-sqrt-e | 1964 (defconst math-approx-sqrt-e |
1963 (eval-when-compile (math-read-number-simple "1.648721270700128146849"))) | 1965 (eval-when-compile (math-read-number-simple "1.648721270700128146849")) |
1966 "An approximation for sqrt(3).") | |
1964 | 1967 |
1965 (math-defcache math-sqrt-e math-approx-sqrt-e | 1968 (math-defcache math-sqrt-e math-approx-sqrt-e |
1966 (math-add-float '(float 1 0) (math-exp-minus-1-raw '(float 5 -1)))) | 1969 (math-add-float '(float 1 0) (math-exp-minus-1-raw '(float 5 -1)))) |
1967 | 1970 |
1968 (math-defcache math-e nil | 1971 (math-defcache math-e nil |
1973 '(float 5 -1))) | 1976 '(float 5 -1))) |
1974 | 1977 |
1975 (defconst math-approx-gamma-const | 1978 (defconst math-approx-gamma-const |
1976 (eval-when-compile | 1979 (eval-when-compile |
1977 (math-read-number-simple | 1980 (math-read-number-simple |
1978 "0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495"))) | 1981 "0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495")) |
1982 "An approximation for gamma.") | |
1979 | 1983 |
1980 (math-defcache math-gamma-const nil | 1984 (math-defcache math-gamma-const nil |
1981 math-approx-gamma-const) | 1985 math-approx-gamma-const) |
1982 | 1986 |
1983 (defun math-half-circle (symb) | 1987 (defun math-half-circle (symb) |