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

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

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

revision 1.14 by jpb, Thu Jul 14 19:46:05 2005 UTC revision 1.15 by jpb, Wed Sep 7 19:27:11 2005 UTC
# Line 1069  Line 1069 
1069           (math-add-or-sub (list '/ (nth 1 (nth 1 expr)) (nth 2 expr))           (math-add-or-sub (list '/ (nth 1 (nth 1 expr)) (nth 2 expr))
1070                            (list '/ (nth 2 (nth 1 expr)) (nth 2 expr))                            (list '/ (nth 2 (nth 1 expr)) (nth 2 expr))
1071                            nil (eq (car (nth 1 expr)) '-)))                            nil (eq (car (nth 1 expr)) '-)))
1072            ((and (eq calc-matrix-mode 'matrix)
1073                  (eq (car-safe expr) '^)
1074                  (natnump (nth 2 expr))
1075                  (> (nth 2 expr) 1)
1076                  (memq (car-safe (nth 1 expr)) '(+ -)))
1077             (if (= (nth 2 expr) 2)
1078                 (math-add-or-sub (list '* (nth 1 (nth 1 expr)) (nth 1 expr))
1079                                  (list '* (nth 2 (nth 1 expr)) (nth 1 expr))
1080                                  nil (eq (car (nth 1 expr)) '-))
1081               (math-add-or-sub (list '* (nth 1 (nth 1 expr)) (list '^ (nth 1 expr)
1082                                                                    (1- (nth 2 expr))))
1083                                (list '* (nth 2 (nth 1 expr)) (list '^ (nth 1 expr)
1084                                                                    (1- (nth 2 expr))))
1085                                nil (eq (car (nth 1 expr)) '-))))
1086          ((and (eq (car-safe expr) '^)          ((and (eq (car-safe expr) '^)
1087                (memq (car-safe (nth 1 expr)) '(+ -))                (memq (car-safe (nth 1 expr)) '(+ -))
1088                (integerp (nth 2 expr))                (integerp (nth 2 expr))
1089                (if (> (nth 2 expr) 0)                (if (and (eq calc-matrix-mode 'matrix)
1090                    (or (and (or (> math-mt-many 500000) (< math-mt-many -500000))                         (> (nth 2 expr) 1))
1091                             (math-expand-power (nth 1 expr) (nth 2 expr)                    (if (= (nth 2 expr) 2)
1092                                                nil t))                        (math-add-or-sub (list '* (nth 1 (nth 1 expr)) (nth 1 expr))
1093                        (list '*                                         (list '* (nth 2 (nth 1 expr)) (nth 1 expr))
1094                              (nth 1 expr)                                         nil (eq (car (nth 1 expr)) '-))
1095                              (list '^ (nth 1 expr) (1- (nth 2 expr)))))                      (math-add-or-sub (list '* (nth 1 (nth 1 expr))
1096                  (if (< (nth 2 expr) 0)                                             (list '^ (nth 1 expr)
1097                      (list '/ 1 (list '^ (nth 1 expr) (- (nth 2 expr))))))))                                                   (1- (nth 2 expr))))
1098                                         (list '* (nth 2 (nth 1 expr))
1099                                               (list '^ (nth 1 expr)
1100                                                     (1- (nth 2 expr))))
1101                                         nil (eq (car (nth 1 expr)) '-)))
1102                    (if (> (nth 2 expr) 0)
1103                        (or (and (or (> math-mt-many 500000) (< math-mt-many -500000))
1104                                 (math-expand-power (nth 1 expr) (nth 2 expr)
1105                                                    nil t))
1106                            (list '*
1107                                  (nth 1 expr)
1108                                  (list '^ (nth 1 expr) (1- (nth 2 expr)))))
1109                      (if (< (nth 2 expr) 0)
1110                          (list '/ 1 (list '^ (nth 1 expr) (- (nth 2 expr)))))))))
1111          (t expr)))          (t expr)))
1112    
1113  (defun calcFunc-expand (expr &optional many)  (defun calcFunc-expand (expr &optional many)

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

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