X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fpseries.cpp;h=bcad8c1960df67a445832d0eb9fcbd24a4c83857;hp=1efbb65d98640db836b2ca5d5a40969d5370e8c4;hb=bb76e4b38b330365934e1b14d2feb2bad416f455;hpb=09e453f232386072bed2b756188162b6615badb1 diff --git a/ginac/pseries.cpp b/ginac/pseries.cpp index 1efbb65d..bcad8c19 100644 --- a/ginac/pseries.cpp +++ b/ginac/pseries.cpp @@ -785,7 +785,15 @@ ex mul::series(const relational & r, int order, unsigned options) const const epvector::const_iterator itend = seq.end(); for (epvector::const_iterator it=itbeg; it!=itend; ++it) { - ex buf = recombine_pair_to_ex(*it); + ex expon = it->coeff; + int factor = 1; + ex buf; + if (expon.info(info_flags::integer)) { + buf = it->rest; + factor = ex_to(expon).to_int(); + } else { + buf = recombine_pair_to_ex(*it); + } int real_ldegree = 0; try { @@ -801,7 +809,7 @@ ex mul::series(const relational & r, int order, unsigned options) const } while (real_ldegree == orderloop); } - ldegrees.push_back(real_ldegree); + ldegrees.push_back(factor * real_ldegree); } int degsum = std::accumulate(ldegrees.begin(), ldegrees.end(), 0);