diff --git a/float.cpp b/float.cpp index 691cfa1f..80070ca9 100644 --- a/float.cpp +++ b/float.cpp @@ -97,7 +97,7 @@ bool ieee_float::almost_equal (floating_t a, floating_t b) { - return almost_equal (a, b, 10000); + return almost_equal (a, b, 10000u); } diff --git a/test/maths/maths.cpp b/test/maths/maths.cpp index b43e38a9..68c8607c 100644 --- a/test/maths/maths.cpp +++ b/test/maths/maths.cpp @@ -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);