[bugfix] log_series: avoid infinite recursion
[ginac.git] / check / exam_inifcns.cpp
index 3a1a36b5bd8d3c615a8ee3211efd782626e0a84a..2fe28415ecaed6c8734b8396b5ceb6db14a88e1f 100644 (file)
@@ -318,6 +318,15 @@ static unsigned inifcns_consist_log()
        if (ex(log(pow(a,b))).is_equal(b*log(a)))
                ++result;
 
+       // infinite recursion log_series
+       ex e(log(-p));
+       ex ser = ex_to<pseries>(e.series(z, 1))
+               .convert_to_poly(/* no_order = */ true);
+       if (!ser.is_equal(e)) {
+               clog << "series(" << e << ", " << z << "): wrong result" << endl;
+               ++result;
+       }
+
        return result;
 }