From f9450a587900dbd7265b7a1b9b3250a6d574bc13 Mon Sep 17 00:00:00 2001 From: "Vladimir V. Kisil" Date: Thu, 13 Jan 2022 20:59:21 +0100 Subject: [PATCH] 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 . --- ginac/normal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.49.0