]> www.ginac.de Git - ginac.git/blobdiff - ginac/normal.cpp
- expairseq::to_rational(): Fixed thinko.
[ginac.git] / ginac / normal.cpp
index cdaf8367f7cdfe68a98ff44e594f96ee03fb57bd..1126d27c2fffb738e3c6cf57decf92af6dc430f0 100644 (file)
@@ -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());
 }