diff options
| -rw-r--r-- | lisp/calc/calc-ext.el | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index b517a54c6f0..5a334778aa5 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el | |||
| @@ -2213,6 +2213,25 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 2213 | a | 2213 | a |
| 2214 | (math-reject-arg a 'constp))) | 2214 | (math-reject-arg a 'constp))) |
| 2215 | 2215 | ||
| 2216 | ;;; Some functions for working with error forms. | ||
| 2217 | (defun math-get-value (x) | ||
| 2218 | "Get the mean value of the error form X. | ||
| 2219 | If X is not an error form, return X." | ||
| 2220 | (if (eq (car-safe x) 'sdev) | ||
| 2221 | (nth 1 x) | ||
| 2222 | x)) | ||
| 2223 | |||
| 2224 | (defun math-get-sdev (x &optional one) | ||
| 2225 | "Get the standard deviation of the error form X. | ||
| 2226 | If X is not an error form, return 1." | ||
| 2227 | (if (eq (car-safe x) 'sdev) | ||
| 2228 | (nth 2 x) | ||
| 2229 | (if one 1 0))) | ||
| 2230 | |||
| 2231 | (defun math-contains-sdev-p (ls) | ||
| 2232 | "Non-nil if the list LS contains an error form." | ||
| 2233 | (let ((ls (if (eq (car-safe ls) 'vec) (cdr ls) ls))) | ||
| 2234 | (memq t (mapcar (lambda (x) (eq (car-safe x) 'sdev)) ls)))) | ||
| 2216 | 2235 | ||
| 2217 | ;;; Coerce integer A to be a small integer. [S I] | 2236 | ;;; Coerce integer A to be a small integer. [S I] |
| 2218 | (defun math-fixnum (a) | 2237 | (defun math-fixnum (a) |