X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Ftests%2Frealops.cpp;h=61d747cb13e29e672c6d366203e325b2964d3c7f;hp=4ac54ff23acc4a03a094ea2950cad6b62b009766;hb=e35bf651e7ebfe4932e877780bb00397c41a7ec2;hpb=b02dcbab39b8c28b9baa41436842ca9fe4ae7ffd diff --git a/src/tests/realops.cpp b/src/tests/realops.cpp index 4ac54ff..61d747c 100644 --- a/src/tests/realops.cpp +++ b/src/tests/realops.cpp @@ -1,3 +1,7 @@ +/** + * Test mathematical operations on the Real type and consistency with double + */ + #include "main.h" #include "real.h" @@ -10,7 +14,7 @@ static double g_totalerror = 0; bool NotEqual(double a, double b, double threshold=1e-1) { - double error = (fabs(a-b) > threshold); + double error = fabs(a-b); g_totalerror += error; return (error > threshold); } @@ -22,7 +26,7 @@ int main(int argc, char ** argv) unsigned failures = 0; for (unsigned i = 0; i < TEST_CASES; ++i) { - Debug("Test %u of %u", i, TEST_CASES); + //Debug("Test %u of %u", i, TEST_CASES); double da = (double)(rand() + 1) / (double)(rand() + 1); double db = (double)(rand() + 1) / (double)(rand() + 1);