Mercurial > emacs
diff lisp/calc/calcalg2.el @ 90044:cb7f41387eb3
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-70
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-669
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-678
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-679
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-680
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-688
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-690
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-691
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-69
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-70
- miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-71
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 12 Nov 2004 02:53:04 +0000 |
parents | 68c22ea6027c 771eb065ad11 |
children | b637c617432f |
line wrap: on
line diff
--- a/lisp/calc/calcalg2.el Thu Nov 04 08:55:40 2004 +0000 +++ b/lisp/calc/calcalg2.el Fri Nov 12 02:53:04 2004 +0000 @@ -738,8 +738,12 @@ (setcar (cdr cur-record) 'cancelled))) (math-replace-integral-parts (car expr))))))) +(defvar math-linear-subst-tried t + "Non-nil means that a linear substitution has been tried.") + (defun math-do-integral (expr) - (let (t1 t2) + (let ((math-linear-subst-tried nil) + t1 t2) (or (cond ((not (math-expr-contains expr math-integ-var)) (math-mul expr math-integ-var)) ((equal expr math-integ-var) @@ -977,9 +981,8 @@ ;; Integration by substitution, for various likely sub-expressions. ;; (In first pass, we look only for sub-exprs that are linear in X.) - (or (if math-enable-subst - (math-integ-try-substitutions expr) - (math-integ-try-linear-substitutions expr)) + (or (math-integ-try-linear-substitutions expr) + (math-integ-try-substitutions expr) ;; If function has sines and cosines, try tan(x/2) substitution. (and (let ((p (setq rat-in (math-expr-rational-in expr)))) @@ -1189,6 +1192,7 @@ ;;; Look for substitutions of the form u = a x + b. (defun math-integ-try-linear-substitutions (sub-expr) + (setq math-linear-subst-tried t) (and (not (Math-primp sub-expr)) (or (and (not (memq (car sub-expr) '(+ - * / neg))) (not (and (eq (car sub-expr) '^)