json icon indicating copy to clipboard operation
json copied to clipboard

Fix tests failing for 32-bit targets

Open grisumbras opened this issue 4 years ago • 4 comments

When an integer is converted to a floating point type which cannot hold it without loss of precision, the conversion is implementation-defined. This apparently means, that the conversion can result in slightly different results for the same number in different functions. Because of this several tests were failing for some 32 bit targets with optimizations enabled (#576). This change removes those tests and instead adds an equivalent test that uses an integer value that can be converted to float without loss of precision.

The question is, should we remove other similar tests that involve lossy conversions? Also, maybe instead of removing those tests, we should check that the results are within and allowed interval?

grisumbras avatar Jul 06 '21 19:07 grisumbras

Codecov Report

Merging #593 (ccf41db) into develop (745be88) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #593   +/-   ##
========================================
  Coverage    99.05%   99.05%           
========================================
  Files           68       68           
  Lines         6114     6114           
========================================
  Hits          6056     6056           
  Misses          58       58           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 745be88...ccf41db. Read the comment docs.

codecov[bot] avatar Jul 06 '21 19:07 codecov[bot]

Did this get resolved? Or merged?

vinniefalco avatar Jul 12 '21 17:07 vinniefalco

No, I'm working on an alternative that doesn't simply drop EQUF tests, but replaces them with different tests.

grisumbras avatar Jul 12 '21 18:07 grisumbras