diff --git a/float.cpp b/float.cpp index 666cc3e4..ffafb0d0 100644 --- a/float.cpp +++ b/float.cpp @@ -80,7 +80,8 @@ template bool ieee_float::almost_equal (floating_t a, floating_t b) { - static const floating_t epsilon = 0.001; + // Static cast to avoid integer casting warnings when using uint16_t for half + static const floating_t epsilon = static_cast (0.001); const floating_t diff = fabs (a - b); // * Use an exact equality first so that infinities are not indirectly compared. This would generate NaNs in the diff.