For floating constants to be of parent floating type

This commit is contained in:
Danny Robson 2012-06-13 14:45:00 +10:00
parent c31ddc0409
commit 281c1bed99

View File

@ -80,7 +80,8 @@ template <unsigned int E, unsigned int S>
bool
ieee_float<E, S>::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<floating_t> (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.