]> www.ginac.de Git - ginac.git/commitdiff
Fixed bug in Taylor expansion.
authorJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Thu, 11 Mar 2004 15:53:18 +0000 (15:53 +0000)
committerJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Thu, 11 Mar 2004 15:53:18 +0000 (15:53 +0000)
ginac/pseries.cpp

index 23c4f94ba81c604cc5e2f25fe1ce0953d622a1a1..692bb6f03d105140330a30973efbb74490681ec1 100644 (file)
@@ -511,9 +511,10 @@ bool pseries::is_terminating(void) const
 ex basic::series(const relational & r, int order, unsigned options) const
 {
        epvector seq;
+       const symbol &s = ex_to<symbol>(r.lhs());
 
        // default for order-values that make no sense for Taylor expansion
-       if (order <= 0) {
+       if ((order <= 0) && this->has(s)) {
                seq.push_back(expair(Order(_ex1), order));
                return pseries(r, seq);
        }
@@ -522,7 +523,6 @@ ex basic::series(const relational & r, int order, unsigned options) const
        numeric fac = 1;
        ex deriv = *this;
        ex coeff = deriv.subs(r, subs_options::no_pattern);
-       const symbol &s = ex_to<symbol>(r.lhs());
 
        if (!coeff.is_zero()) {
                seq.push_back(expair(coeff, _ex0));