Approx is incorrect for small margins
Open
Not a bug
Resolved - pending review
- Dominant language
- C++
- Stars
- 21.5k
- Forks
- 3.5k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 2
Description
The following test will incorrectly fail:
REQUIRE(Approx(1.0).margin(0.0000001) != 1.000001);
This is because of the default value for epsilon in the Approx class and the fact that Approx::equalityComparisonImpl will pass if the value is in the range of the margin OR the epsilon values.
Changing the default value of epsilon to zero fixes the bug but doesn't provide the desired default behaviour for Assert.
Contributor guide
Assessment
This issue has not been assessed yet.