X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fnormal.cpp;h=1126d27c2fffb738e3c6cf57decf92af6dc430f0;hp=cdaf8367f7cdfe68a98ff44e594f96ee03fb57bd;hb=a74473453218570d22f8932cc39ab48c7f0021ae;hpb=af0c47009ca7a15af966430bdf1a72fe05c1c6f9 diff --git a/ginac/normal.cpp b/ginac/normal.cpp index cdaf8367..1126d27c 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -2093,10 +2093,14 @@ ex expairseq::to_rational(lst &repl_lst) const epvector s; s.reserve(seq.size()); for (epvector::const_iterator it=seq.begin(); it!=seq.end(); ++it) { - s.push_back(combine_ex_with_coeff_to_pair((*it).rest.to_rational(repl_lst), - (*it).coeff)); + s.push_back(split_ex_to_pair(recombine_pair_to_ex(*it).to_rational(repl_lst))); + // s.push_back(combine_ex_with_coeff_to_pair((*it).rest.to_rational(repl_lst), } - return thisexpairseq(s, overall_coeff); + ex oc = overall_coeff.to_rational(repl_lst); + if (oc.info(info_flags::numeric)) + return thisexpairseq(s, overall_coeff); + else s.push_back(combine_ex_with_coeff_to_pair(oc,_ex1())); + return thisexpairseq(s, default_overall_coeff()); }