From 1c85bdb25fe8fed52caf39e5ec35d6d14e6d837c Mon Sep 17 00:00:00 2001 From: Chris Dams Date: Tue, 4 Apr 2006 20:55:15 +0000 Subject: [PATCH] Alexei Sheplyakovs patch for making collect_common_factors also work with negative powers of common factors. --- ginac/normal.cpp | 2 ++ 1 file changed, 2 insertions(+) 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); } -- 2.44.0