From: Chris Dams Date: Tue, 4 Apr 2006 20:55:15 +0000 (+0000) Subject: Alexei Sheplyakovs patch for making collect_common_factors also work with X-Git-Tag: release_1-4-0~98 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=1c85bdb25fe8fed52caf39e5ec35d6d14e6d837c 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); }