emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calc/calc-arith.el


From: Jay Belanger
Subject: [Emacs-diffs] Changes to emacs/lisp/calc/calc-arith.el
Date: Thu, 27 Oct 2005 23:51:36 -0400

Index: emacs/lisp/calc/calc-arith.el
diff -c emacs/lisp/calc/calc-arith.el:1.18 emacs/lisp/calc/calc-arith.el:1.19
*** emacs/lisp/calc/calc-arith.el:1.18  Mon Oct 10 19:59:18 2005
--- emacs/lisp/calc/calc-arith.el       Fri Oct 28 03:51:36 2005
***************
*** 1386,1391 ****
--- 1386,1392 ----
        (and (eq (car-safe b) '^)
           (Math-looks-negp (nth 2 b))
           (not (and (eq (car-safe a) '^) (Math-looks-negp (nth 2 a))))
+            (not (math-known-matrixp (nth 1 b)))
           (math-div a (math-normalize
                        (list '^ (nth 1 b) (math-neg (nth 2 b))))))
        (and (eq (car-safe a) '/)
***************
*** 1427,1432 ****
--- 1428,1457 ----
                    (list 'calcFunc-idn (math-mul a (nth 1 b))))
               (and (math-known-matrixp a)
                    (math-mul a (nth 1 b)))))
+       (and (math-identity-matrix-p a t)
+            (or (and (eq (car-safe b) 'calcFunc-idn)
+                     (= (length b) 2)
+                     (list 'calcFunc-idn (math-mul 
+                                          (nth 1 (nth 1 a))
+                                          (nth 1 b))
+                           (1- (length a))))
+                (and (math-known-scalarp b)
+                     (list 'calcFunc-idn (math-mul 
+                                          (nth 1 (nth 1 a)) b)
+                           (1- (length a))))
+                (and (math-known-matrixp b)
+                     (math-mul (nth 1 (nth 1 a)) b))))
+       (and (math-identity-matrix-p b t)
+            (or (and (eq (car-safe a) 'calcFunc-idn)
+                     (= (length a) 2)
+                     (list 'calcFunc-idn (math-mul (nth 1 a) 
+                                                   (nth 1 (nth 1 b)))
+                           (1- (length b))))
+                (and (math-known-scalarp a)
+                     (list 'calcFunc-idn (math-mul a (nth 1 (nth 1 b))) 
+                           (1- (length b))))
+                (and (math-known-matrixp a)
+                     (math-mul a (nth 1 (nth 1 b))))))
        (and (math-looks-negp b)
           (math-mul (math-neg a) (math-neg b)))
        (and (eq (car-safe b) '-)
***************
*** 1706,1712 ****
        (math-div-new-non-trig term))))
  
  (defun math-div-symb-fancy (a b)
!   (or (and math-simplify-only
           (not (equal a math-simplify-only))
           (list '/ a b))
        (and (Math-equal-int b 1) a)
--- 1731,1739 ----
        (math-div-new-non-trig term))))
  
  (defun math-div-symb-fancy (a b)
!   (or (and (math-known-matrixp b)
!            (math-mul a (math-pow b -1)))
!       (and math-simplify-only
           (not (equal a math-simplify-only))
           (list '/ a b))
        (and (Math-equal-int b 1) a)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]