Make series expansion work with non-rational functions. Patch by Alexei.
authorChris Dams <Chris.Dams@mi.infn.it>
Tue, 13 Feb 2007 15:14:14 +0000 (15:14 +0000)
committerChris Dams <Chris.Dams@mi.infn.it>
Tue, 13 Feb 2007 15:14:14 +0000 (15:14 +0000)
ginac/pseries.cpp

index 0e1f183322c47114404c1c4c7b502f6cc44d68f4..1e61e0aee18b8066eea85bf1360572a3b3d86074 100644 (file)
@@ -1100,7 +1100,10 @@ ex power::series(const relational & r, int order, unsigned options) const
        }
        const ex& sym = r.lhs();
        // find existing minimal degree
-       int real_ldegree = basis.expand().ldegree(sym-r.rhs());
+       ex eb = basis.expand();
+       int real_ldegree = 0;
+       if (eb.info(info_flags::rational_function))
+               real_ldegree = eb.ldegree(sym-r.rhs());
        if (real_ldegree == 0) {
                int orderloop = 0;
                do {