]> www.ginac.de Git - ginac.git/blobdiff - check/exam_numeric.cpp
[BUGFIX] numeric::info(nonnegative): correctly handle complex numbers.
[ginac.git] / check / exam_numeric.cpp
index e44b995a774ed112a97622ecb12370ccb012ed39..d5ae27b27a1e5da5354271a5e65e90703e035c90 100644 (file)
@@ -4,7 +4,7 @@
  *  tests on these numbers like is_integer() etc... */
 
 /*
- *  GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2011 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -68,6 +68,11 @@ static unsigned exam_numeric1()
                     << " erroneously not recognized as complex rational" << endl;
                ++result;
        }
+       if (test_crat.info(info_flags::nonnegative)) {
+               clog << test_crat
+                    << " erroneously recognized as non-negative number" << endl;
+               ++result;
+       }
        
        int i = numeric(1984).to_int();
        if (i-1984) {