]> www.ginac.de Git - ginac.git/blobdiff - check/exam_pseries.cpp
Fix series of positive powers of polynomials.
[ginac.git] / check / exam_pseries.cpp
index f0fead05232ccd13fd4c6f5559fc28b7c7f41afd..671d57512205d0476eb2ba869e7e99e3e429315b 100644 (file)
@@ -390,6 +390,24 @@ static unsigned exam_series14()
        return result;
 }
 
+// Test expansion of powers of polynomials.
+static unsigned exam_series15()
+{
+       unsigned result = 0;
+
+       ex e = pow(x + pow(x,2), 2);
+
+       result += check_series(e, 0, Order(1), 0);
+       result += check_series(e, 0, Order(x), 1);
+       result += check_series(e, 0, Order(pow(x,2)), 2);
+       result += check_series(e, 0, pow(x,2) + Order(pow(x,3)), 3);
+       result += check_series(e, 0, pow(x,2) + 2*pow(x,3) + Order(pow(x,4)), 4);
+       result += check_series(e, 0, pow(x,2) + 2*pow(x,3) + pow(x,4), 5);
+       result += check_series(e, 0, pow(x,2) + 2*pow(x,3) + pow(x,4), 6);
+
+       return result;
+}
+
 unsigned exam_pseries()
 {
        unsigned result = 0;
@@ -410,6 +428,7 @@ unsigned exam_pseries()
        result += exam_series12();  cout << '.' << flush;
        result += exam_series13();  cout << '.' << flush;
        result += exam_series14();  cout << '.' << flush;
+       result += exam_series15();  cout << '.' << flush;
        
        return result;
 }