From 3cc5a3a8718bf0d9c06562a01fd86c22ff9840c0 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Tue, 24 Jul 2012 21:38:36 -0500 Subject: [PATCH] calc-alg.el (math-simplify-divide): Don't cross multiply in an equation when the lhs is a variable. --- lisp/ChangeLog | 5 +++++ lisp/calc/calc-alg.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9377f334bd4..7f612cb61a4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-07-25 Jay Belanger + + * calc-alg.el (math-simplify-divide): Don't cross multiply + in an equation when the lhs is a variable. + 2012-07-24 Julien Danjou * net/netrc.el (netrc-find-service-number, netrc-store-data): diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el index 8e41b175321..50b31400a6a 100644 --- a/lisp/calc/calc-alg.el +++ b/lisp/calc/calc-alg.el @@ -530,7 +530,10 @@ (not (Math-realp (nth 1 math-simplify-expr)))) (math-common-constant-factor (nth 1 math-simplify-expr)))) (if (and (eq (car-safe nn) 'frac) (eq (nth 1 nn) 1) (not n)) - (progn + (unless (and (eq (car-safe math-simplify-expr) 'calcFunc-eq) + (eq (car-safe (nth 1 math-simplify-expr)) 'var) + (not (math-expr-contains (nth 2 math-simplify-expr) + (nth 1 math-simplify-expr)))) (setcar (cdr math-simplify-expr) (math-mul (nth 2 nn) (nth 1 math-simplify-expr))) (setcar (cdr (cdr math-simplify-expr)) -- 2.39.2