summaryrefslogtreecommitdiff
path: root/lisp/calc/calcalg3.el
diff options
context:
space:
mode:
authorJay Belanger <jay.p.belanger@gmail.com>2007-11-27 04:56:53 +0000
committerJay Belanger <jay.p.belanger@gmail.com>2007-11-27 04:56:53 +0000
commite5a5704e499899fa73aa0d93613d140b4d4fb7c4 (patch)
tree0907fbcee9b49bb748698e9d0f9e121d9c003951 /lisp/calc/calcalg3.el
parentae51ae1108370a4dcce5368cc5399ce57694db8c (diff)
(math-map-binop): New function.
(calc-curve-fit): Replace `mapcar*' by `math-map-binop'.
Diffstat (limited to 'lisp/calc/calcalg3.el')
-rw-r--r--lisp/calc/calcalg3.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el
index 5d129b37f7..374b0487cf 100644
--- a/lisp/calc/calcalg3.el
+++ b/lisp/calc/calcalg3.el
@@ -43,6 +43,13 @@
(declare-function math-max-list "calc-arith" (a b))
+(defun math-map-binop (binop args1 args2)
+ "Apply BINOP to the elements of the lists ARGS1 and ARGS2"
+ (if args1
+ (cons
+ (funcall binop (car args1) (car args2))
+ (funcall 'math-map-binop binop (cdr args1) (cdr args2)))))
+
(defun calc-find-root (var)
(interactive "sVariable(s) to solve for: ")
(calc-slow-wrapper
@@ -250,9 +257,9 @@
(nth 1 plot)
(cons
'vec
- (mapcar* 'calcFunc-div
- (cdr (nth 2 plot))
- (cdr (nth 1 plot)))))))
+ (math-map-binop 'calcFunc-div
+ (cdr (nth 2 plot))
+ (cdr (nth 1 plot)))))))
(calc-fit-hubbert-linear-curve func))
((memq key '(?e ?E))
(calc-get-fit-variables calc-curve-nvars