]> www.ginac.de Git - ginac.git/commitdiff
fixed another power::series() bug [Alexei Sheplyakov]
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Wed, 6 Oct 2004 15:59:20 +0000 (15:59 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Wed, 6 Oct 2004 15:59:20 +0000 (15:59 +0000)
check/exam_pseries.cpp
ginac/pseries.cpp

index 040c5e58a047d2e1712109467e95ea2493ca6a87..1e34be780109581d56527c2486927dc8d9c26231 100644 (file)
@@ -133,6 +133,10 @@ static unsigned exam_series1()
        d = log(a*x) + b/a*log(x)*x - pow(b/a, 2)/2*pow(log(x)*x, 2) + Order(pow(x, 3));
        result += check_series(e, 0, d, 3);
 
+       e = pow((x+a), b);
+       d = pow(a, b) + (pow(a, b)*b/a)*x + (pow(a, b)*b*b/a/a/2 - pow(a, b)*b/a/a/2)*pow(x, 2) + Order(pow(x, 3));
+       result += check_series(e, 0, d, 3);
+
        return result;
 }
 
index 993eacf119f7583903747f2a92577f59fa508841..4ec5bcefca4e1f559a7b326f9b9c400fc5f55f4f 100644 (file)
@@ -952,11 +952,13 @@ ex power::series(const relational & r, int order, unsigned options) const
        }
 
        // Is the expression of type something^(-int)?
-       if (!must_expand_basis && !exponent.info(info_flags::negint) && !is_a<add>(basis))
+       if (!must_expand_basis && !exponent.info(info_flags::negint)
+        && (!is_a<add>(basis) || !is_a<numeric>(exponent)))
                return basic::series(r, order, options);
 
        // Is the expression of type 0^something?
-       if (!must_expand_basis && !basis.subs(r, subs_options::no_pattern).is_zero() && !is_a<add>(basis))
+       if (!must_expand_basis && !basis.subs(r, subs_options::no_pattern).is_zero()
+        && (!is_a<add>(basis) || !is_a<numeric>(exponent)))
                return basic::series(r, order, options);
 
        // Singularity encountered, is the basis equal to (var - point)?