For floating constants to be of parent floating type
This commit is contained in:
parent
c31ddc0409
commit
281c1bed99
@ -80,7 +80,8 @@ template <unsigned int E, unsigned int S>
|
|||||||
bool
|
bool
|
||||||
ieee_float<E, S>::almost_equal (floating_t a,
|
ieee_float<E, S>::almost_equal (floating_t a,
|
||||||
floating_t b) {
|
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);
|
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.
|
// * Use an exact equality first so that infinities are not indirectly compared. This would generate NaNs in the diff.
|
||||||
|
Loading…
Reference in New Issue
Block a user