/*
- Copyright (C) 2012 Paul Davis
+ Copyright (C) 2012 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
bool negative() const { return (i >> 31) != 0; }
int32_t raw_mantissa() const { return i & ((1 << 23) - 1); }
int32_t raw_exponent() const { return (i >> 23) & 0xFF; }
-
+
int32_t i;
float f;
};
-
+
/* Note: ULPS = Units in the Last Place */
static inline bool floateq (float a, float b, int max_ulps_diff)
{
Float_t ua (a);
Float_t ub (b);
-
+
if (a == b) {
return true;
}
if (ulps_diff <= max_ulps_diff) {
return true;
}
-
+
return false;
}