float: lower ULPs threshold for almost_equal
we weren't detecting differences with 4 decimal point differences
This commit is contained in:
parent
6bb287fe04
commit
08b6cbacea
@ -97,7 +97,7 @@ bool
|
||||
ieee_float<E, S>::almost_equal (floating_t a,
|
||||
floating_t b)
|
||||
{
|
||||
return almost_equal (a, b, 10000u);
|
||||
return almost_equal (a, b, 100u);
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,6 +54,10 @@ test_comparisons (util::TAP::logger &tap)
|
||||
tap.expect (!almost_equal (numeric_limits<double>::quiet_NaN (),
|
||||
numeric_limits<double>::quiet_NaN ()),
|
||||
"not almost_equal NaN/NaN");
|
||||
|
||||
// Compare reasonably close values that are wrong
|
||||
tap.expect (!almost_equal (1.0000f, 1.0001f), ".0001f difference inequality");
|
||||
tap.expect ( almost_equal (1.0000f, 1.00001f), ".00001f difference inequality");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user