float: tighten up almost_equal tolerance

This commit is contained in:
Danny Robson 2015-01-29 15:47:59 +11:00
parent cf5a682959
commit 6bf011efa4
2 changed files with 5 additions and 1 deletions

View File

@ -97,7 +97,7 @@ bool
ieee_float<E, S>::almost_equal (floating_t a,
floating_t b)
{
return almost_equal (a, b, 10000);
return almost_equal (a, b, 10000u);
}

View File

@ -26,6 +26,10 @@ main (int, char **) {
CHECK (almost_equal (0.f, -0.f));
CHECK (almost_equal (0., -0.));
CHECK ( almost_zero (1e-45f));
CHECK (!almost_zero (1e-40f));
CHECK (!exactly_zero (1e-45f));
CHECK_EQ (min (-2, 0, 2), -2);
CHECK_EQ (max (-2, 0, 2), 2);