]> www.ginac.de Git - ginac.git/blobdiff - ginac/numeric.cpp
mul::info(): cache the result of the positiveness/negativeness checks, ...
[ginac.git] / ginac / numeric.cpp
index f05763da1fe9d4ef231b6cbd88cd5018706ac5ff..795c76099172dba5d5284fd6fc08c4183428fc3d 100644 (file)
@@ -24,7 +24,9 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #include "numeric.h"
 #include "ex.h"
@@ -700,7 +702,7 @@ bool numeric::info(unsigned inf) const
                case info_flags::negative:
                        return is_negative();
                case info_flags::nonnegative:
-                       return !is_negative();
+                       return is_zero() || is_positive();
                case info_flags::posint:
                        return is_pos_integer();
                case info_flags::negint: