X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Ftests%2Fparanoidtester.cpp;h=477dea2ccc19c56cd05aa2780964efc66b098fcc;hp=82d14d7edfc141c9ca9c0c58190f973e6146a00f;hb=03cc1b0a0d0705e0b1d92e13fdb18608c7a00272;hpb=ea748154f1bc7dbc81cb52611a52865e63109439 diff --git a/src/tests/paranoidtester.cpp b/src/tests/paranoidtester.cpp index 82d14d7..477dea2 100644 --- a/src/tests/paranoidtester.cpp +++ b/src/tests/paranoidtester.cpp @@ -32,7 +32,7 @@ string RandomNumberAsString(int max_digits = 3) bool CloseEnough(long double d, ParanoidNumber & p, long double eps = 1e-6) { - long double pd = p.Convert(); + double pd = p.ToDouble(); if (d == 0) return fabs(pd) <= eps; @@ -217,8 +217,13 @@ void TestRandomisedOps(int test_cases = 1000, int ops_per_case = 1, int max_digi Warn("double Yields: %.40lf", da); Warn("PN Yields: %.40lf", a.ToDouble()); } + if (i == test_cases - 1) + { + Debug("double: %.40lf", da); + Debug("PN: %.40lf", a.ToDouble()); + } } - Debug("Complete!"); + } @@ -228,7 +233,6 @@ int main(int argc, char ** argv) { TestAddSubIntegers(100); TestMulDivIntegers(100); - //return 0; for (int i = 1; i <= 100; ++i) TestRandomisedOps(1000, i); return 0;