New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix float comparison precision #102
Fix float comparison precision #102
Conversation
The following test failures in PHPUnit 8.5's test suite now occur:
@mvorisek Can you please send a PR to PHPUnit's |
this PR is continuation of sebastianbergmann/phpunit@136fae3 which effectively implies zero delta for numbers greater than 1 - that is why you hit this problem also, casting from float to string depends on php.ini |
@mvorisek Yep wasn't much of work to fix the issues when it became clear why 👍 Also big fan of this change, just wanted to add a comment here for people in the future hitting this. |
needed for sebastianbergmann/phpunit#4972
fixed EPSILON was problematic and small values like
1E-100
and1E-200
were considered the samethis PR removes the
DoubleComparator
completely, if number is supposed to be compared unexactly, delta can be passed toNumericComparator