Alexei Sheplyakovs patch for making collect_common_factors also work with
authorChris Dams <Chris.Dams@mi.infn.it>
Tue, 4 Apr 2006 20:55:15 +0000 (20:55 +0000)
committerChris Dams <Chris.Dams@mi.infn.it>
Tue, 4 Apr 2006 20:55:15 +0000 (20:55 +0000)
negative powers of common factors.

ginac/normal.cpp

index db1ca467e422f856e4687bb3b5b58f3889ada51c..7b90030de6b0fb595b781b9f3c7a532ad4e6c015 100644 (file)
@@ -2388,6 +2388,8 @@ ex power::to_polynomial(exmap & repl) const
 {
        if (exponent.info(info_flags::posint))
                return power(basis.to_rational(repl), exponent);
+       else if (exponent.info(info_flags::negint))
+               return power(replace_with_symbol(power(basis, _ex_1), repl), -exponent);
        else
                return replace_with_symbol(*this, repl);
 }