You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🐛 use fuzzy comparison for floating point in const evaluation equality check (#809)
## Description
This PR fixes another small bug observed as part of #803, which only
surfaced under macOS when using GCC as the compiler.
Turns out that GitHub's CodeQL was right after all and exact equality
checks on floating point values can come back to bite you.
In this case, two computations of `std::tan(1.0)` resulted in values
that were off by a single ULP.
Although I am not 100% certain how this can even happen, this PR works
around any such errors by using a fuzzy floating point comparison with
an epsilon on the order of `10-12`.
## Checklist:
<!---
This checklist serves as a reminder of a couple of things that ensure
your pull request will be merged swiftly.
-->
- [x] The pull request only contains commits that are related to it.
- [x] I have added appropriate tests and documentation.
- [x] I have made sure that all CI jobs on GitHub pass.
- [x] The pull request introduces no new warnings and follows the
project's style guidelines.
0 commit comments