]> www.ginac.de Git - ginac.git/commitdiff
G_do_hoelder: fix case with real x values which are not of type cl_R.
authorStefan Weinzierl <weinzierl@uni-mainz.de>
Wed, 12 Dec 2018 21:53:12 +0000 (22:53 +0100)
committerRichard Kreckel <kreckel@ginac.de>
Wed, 12 Dec 2018 21:53:12 +0000 (22:53 +0100)
In CLN, a complex number of type cl_N with vanishing imaginary part is not
necessarily a real number of type cl_R.

This bug has been reported by T. Huber.

ginac/inifcns_nstdsums.cpp

index c39bfb7c5bd5ac701d5723599a1179eda2a9739f..ce6ceb19b2d9f8ce0f98874fbcce71a1b0e3cba9 100644 (file)
@@ -1006,7 +1006,7 @@ G_do_hoelder(std::vector<cln::cl_N> x, /* yes, it's passed by value */
                std::vector<int> qlsts;
                for (std::size_t j = r; j >= 1; --j) {
                        qlstx.push_back(cln::cl_N(1) - x[j-1]);
                std::vector<int> qlsts;
                for (std::size_t j = r; j >= 1; --j) {
                        qlstx.push_back(cln::cl_N(1) - x[j-1]);
-                       if (instanceof(x[j-1], cln::cl_R_ring) && realpart(x[j-1]) > 1) {
+                       if (imagpart(x[j-1])==0 && realpart(x[j-1]) >= 1) {
                                qlsts.push_back(1);
                        } else {
                                qlsts.push_back(-s[j-1]);
                                qlsts.push_back(1);
                        } else {
                                qlsts.push_back(-s[j-1]);