From: Chris Dams Date: Tue, 4 Apr 2006 21:04:52 +0000 (+0000) Subject: Alexei Sheplyakovs patch for making collect_common_factors also work with X-Git-Tag: release_1-3-4~2 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=commitdiff_plain;h=8ca5969407dac2f8c33f3512c914740f3c4dc283;p=ginac.git Alexei Sheplyakovs patch for making collect_common_factors also work with negative powers of common factors. --- diff --git a/ginac/normal.cpp b/ginac/normal.cpp index db1ca467..7b90030d 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -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); }