From: Vladimir V. Kisil Date: Thu, 13 Jan 2022 19:59:21 +0000 (+0100) Subject: Fix power::to_polynomial() for posint exponents. X-Git-Tag: release_1-8-3~10 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=commitdiff_plain;h=f9450a587900dbd7265b7a1b9b3250a6d574bc13;p=ginac.git Fix power::to_polynomial() for posint exponents. This makes things like pow(x+1/x,2).to_polynomial(repl) actually produce (x+sym)^2 with sym==1/x in repl, as it should. Reported by Feng Feng . --- diff --git a/ginac/normal.cpp b/ginac/normal.cpp index 7c99bed7..3a36944c 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -2688,7 +2688,7 @@ ex power::to_rational(exmap & repl) const ex power::to_polynomial(exmap & repl) const { if (exponent.info(info_flags::posint)) - return pow(basis.to_rational(repl), exponent); + return pow(basis.to_polynomial(repl), exponent); else if (exponent.info(info_flags::negint)) { ex basis_pref = collect_common_factors(basis);