/[emacs]/emacs/lisp/calc/calc-arith.el
ViewVC logotype

Diff of /emacs/lisp/calc/calc-arith.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by jpb, Mon Oct 10 19:59:18 2005 UTC revision 1.19 by jpb, Fri Oct 28 03:51:36 2005 UTC
# Line 1386  Line 1386 
1386        (and (eq (car-safe b) '^)        (and (eq (car-safe b) '^)
1387             (Math-looks-negp (nth 2 b))             (Math-looks-negp (nth 2 b))
1388             (not (and (eq (car-safe a) '^) (Math-looks-negp (nth 2 a))))             (not (and (eq (car-safe a) '^) (Math-looks-negp (nth 2 a))))
1389               (not (math-known-matrixp (nth 1 b)))
1390             (math-div a (math-normalize             (math-div a (math-normalize
1391                          (list '^ (nth 1 b) (math-neg (nth 2 b))))))                          (list '^ (nth 1 b) (math-neg (nth 2 b))))))
1392        (and (eq (car-safe a) '/)        (and (eq (car-safe a) '/)
# Line 1427  Line 1428 
1428                      (list 'calcFunc-idn (math-mul a (nth 1 b))))                      (list 'calcFunc-idn (math-mul a (nth 1 b))))
1429                 (and (math-known-matrixp a)                 (and (math-known-matrixp a)
1430                      (math-mul a (nth 1 b)))))                      (math-mul a (nth 1 b)))))
1431          (and (math-identity-matrix-p a t)
1432               (or (and (eq (car-safe b) 'calcFunc-idn)
1433                        (= (length b) 2)
1434                        (list 'calcFunc-idn (math-mul
1435                                             (nth 1 (nth 1 a))
1436                                             (nth 1 b))
1437                              (1- (length a))))
1438                   (and (math-known-scalarp b)
1439                        (list 'calcFunc-idn (math-mul
1440                                             (nth 1 (nth 1 a)) b)
1441                              (1- (length a))))
1442                   (and (math-known-matrixp b)
1443                        (math-mul (nth 1 (nth 1 a)) b))))
1444          (and (math-identity-matrix-p b t)
1445               (or (and (eq (car-safe a) 'calcFunc-idn)
1446                        (= (length a) 2)
1447                        (list 'calcFunc-idn (math-mul (nth 1 a)
1448                                                      (nth 1 (nth 1 b)))
1449                              (1- (length b))))
1450                   (and (math-known-scalarp a)
1451                        (list 'calcFunc-idn (math-mul a (nth 1 (nth 1 b)))
1452                              (1- (length b))))
1453                   (and (math-known-matrixp a)
1454                        (math-mul a (nth 1 (nth 1 b))))))
1455        (and (math-looks-negp b)        (and (math-looks-negp b)
1456             (math-mul (math-neg a) (math-neg b)))             (math-mul (math-neg a) (math-neg b)))
1457        (and (eq (car-safe b) '-)        (and (eq (car-safe b) '-)
# Line 1706  Line 1731 
1731        (math-div-new-non-trig term))))        (math-div-new-non-trig term))))
1732    
1733  (defun math-div-symb-fancy (a b)  (defun math-div-symb-fancy (a b)
1734    (or (and math-simplify-only    (or (and (math-known-matrixp b)
1735               (math-mul a (math-pow b -1)))
1736          (and math-simplify-only
1737             (not (equal a math-simplify-only))             (not (equal a math-simplify-only))
1738             (list '/ a b))             (list '/ a b))
1739        (and (Math-equal-int b 1) a)        (and (Math-equal-int b 1) a)

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26