BlueQuartzSoftware / DREAM3D

Data Analysis program and framework for materials science data analytics, based on the managing framework SIMPL framework.
http://dream3d.bluequartz.net
Other
158 stars 73 forks source link

DREAM3D_COMPARE_FLOATS fails near zero #456

Open wlenthe opened 8 years ago

wlenthe commented 8 years ago

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)

wlenthe commented 8 years ago

It turns out the Bruce Dawson recognized the same issue and has an updated version of the code . Since it is only currently used in 1 place (that isn't in the current build) I can update the code based on his new version if that is an acceptable solution.

imikejackson commented 8 years ago

http://my.cdash.org/buildSummary.php?buildid=829027

The builds are now failing for OS X and LINUX.

wlenthe commented 8 years ago

The updated DataFusion tests were written with this pull request implemented and will build correctly when it is merged (I didn't realize it was part of the nightly, sorry). In the interim I can switch them back so they build but the tests fail, just let me know.