Rational(double d=0) : P(d*1e6), Q(1e6) // Possibly the worst thing ever...
{
Simplify();
- //if (!CheckAccuracy(d, "Construct from double"))
- {
- //Fatal("Bwah bwah :(");
- }
}
Rational(const T & _P, const T & _Q) : P(_P), Q(_Q)
#define TEST_CASES 100
-bool NotEqual(double a, double b, double threshold=1e-2)
+static double g_totalerror = 0;
+
+bool NotEqual(double a, double b, double threshold=1e-1)
{
- return (fabs(a-b) > threshold);
+ double error = (fabs(a-b) > threshold);
+ g_totalerror += error;
+ return (error > threshold);
}
int main(int argc, char ** argv)
}
}
Debug("Completed %u test cases with total of %u operations, %u failures", TEST_CASES, 12*TEST_CASES, failures);
+ Debug("Total accumulated difference between Real and Double operations was %f", g_totalerror);
}