summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-ext.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-08-03 05:58:06 +0000
committerMiles Bader <miles@gnu.org>2007-08-03 05:58:06 +0000
commit2ca773ca40d2c1896757e6382aefff6d9de1c5cc (patch)
tree846419ece5e5d8bc8f11e9786598678af9c78f00 /lisp/calc/calc-ext.el
parent49b23c2a404cf31fb1aeecc7932a7304aaf16a67 (diff)
parent0896d93184a719bc994a3e699de27190aac0acb1 (diff)
downloademacs-2ca773ca40d2c1896757e6382aefff6d9de1c5cc.tar.gz
emacs-2ca773ca40d2c1896757e6382aefff6d9de1c5cc.tar.bz2
emacs-2ca773ca40d2c1896757e6382aefff6d9de1c5cc.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 843-845) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 84-87) - Update from CVS - Change capitalization of VC backend names for new backends Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-30
Diffstat (limited to 'lisp/calc/calc-ext.el')
-rw-r--r--lisp/calc/calc-ext.el19
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))))
a
(math-reject-arg a 'constp)))
+;;; Some functions for working with error forms.
+(defun math-get-value (x)
+ "Get the mean value of the error form X.
+If X is not an error form, return X."
+ (if (eq (car-safe x) 'sdev)
+ (nth 1 x)
+ x))
+
+(defun math-get-sdev (x &optional one)
+ "Get the standard deviation of the error form X.
+If X is not an error form, return 1."
+ (if (eq (car-safe x) 'sdev)
+ (nth 2 x)
+ (if one 1 0)))
+
+(defun math-contains-sdev-p (ls)
+ "Non-nil if the list LS contains an error form."
+ (let ((ls (if (eq (car-safe ls) 'vec) (cdr ls) ls)))
+ (memq t (mapcar (lambda (x) (eq (car-safe x) 'sdev)) ls))))
;;; Coerce integer A to be a small integer. [S I]
(defun math-fixnum (a)