From 281c1bed991d5e645ebe0af740efad638dd74030 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 13 Jun 2012 14:45:00 +1000 Subject: [PATCH] For floating constants to be of parent floating type --- float.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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.