]> www.ginac.de Git - ginac.git/blobdiff - check/check_numeric.cpp
* Fix the other half of the test.
[ginac.git] / check / check_numeric.cpp
index 46b78d32d04510fa45001c7fbab5caef87d37f77..74dcf33b27b7e7815a063ea37740b64fbc4deea0 100644 (file)
@@ -60,7 +60,7 @@ static unsigned check_numeric2(void)
        int i_num, i_den;
        
        // Check non-nested radicals (n/d)^(m/n) in ex wrapper class:
-       for (int i=0; i<200; ++i) {  // FIXME: run to ~200
+       for (int i=0; i<200; ++i) {
                for (int j=2; j<13; ++j) {
                        // construct an exponent 1/j...
                        numeric nm(1,j);
@@ -75,13 +75,13 @@ static unsigned check_numeric2(void)
                        ex radical = pow(ex(num)/ex(den),ex(nm));
                        numeric floating = pow(num/den,nm);
                        // test the result:
-                       if (is_ex_of_type(radical,numeric)) {
+                       if (is_a<numeric>(radical)) {
                                clog << "(" << num << "/" << den << ")^(" << nm
                                     << ") should have been a product, instead it's "
                                     << radical << endl;
                                errorflag = true;
                        }
-                       numeric ratio = ex_to_numeric(evalf(radical))/floating;
+                       numeric ratio = abs(ex_to<numeric>(evalf(radical))/floating);
                        if (ratio>1.0001 && ratio<0.9999) {
                                clog << "(" << num << "/" << den << ")^(" << nm
                                     << ") erroneously evaluated to " << radical;