]> www.ginac.de Git - ginac.git/commitdiff
synced to HEAD (series bugfix)
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Wed, 6 Oct 2004 16:03:22 +0000 (16:03 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Wed, 6 Oct 2004 16:03:22 +0000 (16:03 +0000)
NEWS
check/exam_pseries.cpp
ginac/pseries.cpp

diff --git a/NEWS b/NEWS
index 37b6c5fc465ef2b40f3957f12a4efe433cf30ccc..914c986ae343d99d913f201e4c2b555145f4c748 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ This file records noteworthy changes.
 
 1.2.4 (<date>)
 * binomial(n, k) evaluates for non-integer arguments n.
+* Fixed another bug in the series expansion of powers.
 
 1.2.3 (13 August 2004)
 * Added variants of dirac_trace() and color_trace() that take the trace over
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)?