BlueQuartzSoftware / BlueQuartzSoftware/DREAM3D

DREAM3D_COMPARE_FLOATS fails near zero

Open
#456 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.