BlueQuartzSoftware / BlueQuartzSoftware/DREAM3D
DREAM3D_COMPARE_FLOATS fails near zero
Open
Bug
- Dominant language
- C++
- Stars
- 189
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Description
the AlmostEqualUlpsFinal function (called bye the DREAM3D_COMPARE_FLOATS macro) has trouble comparing small values to zero. For example comparing 0.0f to 9.66105 \* 10^-18 fails even when the tolerance is set extremely high e.g. 0xFFFFFFFF.
AlmostEqualUlpsFinal takes pointers but DREAM3D_COMPARE_FLOATS looks like it was originally configured to take values so if the test fails it prints addresses instead of values. Pointers also make use of the macro a bit clunky when comparing to a constant (e.g. DREAM3D_COMPARE_FLOATS(value, 1.0f, 100) isn't valid)
Contributor guide
Assessment
This issue has not been assessed yet.