Browse Source

Corrected the behavior of the term-variable and get-power functions

Samuel W. Flint 9 năm trước cách đây
mục cha
commit
c19b597136
1 tập tin đã thay đổi với 9 bổ sung3 xóa
  1. 9 3
      manipulation.org

+ 9 - 3
manipulation.org

@@ -579,16 +579,22 @@ Foo
   (defun term-variable (term)
     (when (classified-as-p term 'polynomial-term)
       (classification-case term
-                           (multiplicative (second (third term)))
                            (power (second term))
-                           (* nil))))
+                           (multiplicative
+                            (if (listp (third term))
+                                (second (third term))
+                                (third term)))
+                           (numeric nil))))
 
   (defun get-power (term)
     (classification-case term
                          (numeric 0)
                          (variable 1)
                          (power (third term))
-                         (polynomial-term (third (third term)))
+                         (multiplicative
+                          (if (listp (third term))
+                              (third (third term))
+                              1))
                          (* 0)))
 
   (defun same-order-p (term-a term-b)