44 int32_t a_int = *
reinterpret_cast<const int32_t *
>(&left);
47 a_int = 0x80000000 - a_int;
51 int32_t b_int = *
reinterpret_cast<const int32_t *
>(&right);
53 b_int = 0x80000000 - b_int;
55 int32_t int_diff = abs(a_int - b_int);
56 if (int_diff <= max_ulps && -max_ulps <= int_diff) {
69 int64_t a_int = *
reinterpret_cast<const int64_t *
>(&left);
72 a_int = 0x8000000000000000LL - a_int;
76 int64_t b_int = *
reinterpret_cast<const int64_t *
>(&right);
78 b_int = 0x8000000000000000LL - b_int;
80 int64_t int_diff = abs(a_int - b_int);
81 if (int_diff <= max_ulps && -max_ulps <= int_diff) {
ELEMENTS_API const double DBL_DEFAULT_TEST_TOLERANCE
Double precision float default test tolerance.
bool almostEqual2sComplement(ELEMENTS_UNUSED const FloatType &a, ELEMENTS_UNUSED const FloatType &b, ELEMENTS_UNUSED const std::size_t &max_ulps=0)
Floating point comparison implementations.
template bool realBitWiseEqual< double >(const double &left, const double &right)
template bool realBitWiseEqual< float >(const float &left, const float &right)
ELEMENTS_API const double FLT_DEFAULT_TEST_TOLERANCE
Single precision float default test tolerance.