]> www.ginac.de Git - ginac.git/blobdiff - ginac/inifcns_nstdsums.cpp
Fix G3_evalf and G3_eval for real and negative x.
[ginac.git] / ginac / inifcns_nstdsums.cpp
index 043d93a8a081678bd25944e6e54cd66b0bde2570..c33a4cf8370d22020e302b0c08e1ade04f6a24f1 100644 (file)
@@ -1360,12 +1360,16 @@ static ex G3_evalf(const ex& x_, const ex& s_, const ex& y)
                        all_zero = false;
                }
                if ( ex_to<numeric>(*itx).is_real() ) {
-                       if ( *its >= 0 ) {
+                       if ( ex_to<numeric>(*itx).is_positive() ) {
+                               if ( *its >= 0 ) {
+                                       sn.push_back(1);
+                               }
+                               else {
+                                       sn.push_back(-1);
+                               }
+                       } else {
                                sn.push_back(1);
                        }
-                       else {
-                               sn.push_back(-1);
-                       }
                }
                else {
                        if ( ex_to<numeric>(*itx).imag() > 0 ) {
@@ -1424,12 +1428,16 @@ static ex G3_eval(const ex& x_, const ex& s_, const ex& y)
                        all_zero = false;
                }
                if ( ex_to<numeric>(*itx).is_real() ) {
-                       if ( *its >= 0 ) {
+                       if ( ex_to<numeric>(*itx).is_positive() ) {
+                               if ( *its >= 0 ) {
+                                       sn.push_back(1);
+                               }
+                               else {
+                                       sn.push_back(-1);
+                               }
+                       } else {
                                sn.push_back(1);
                        }
-                       else {
-                               sn.push_back(-1);
-                       }
                }
                else {
                        if ( ex_to<numeric>(*itx).imag() > 0 ) {