Fix float comparison precision#102
Fix float comparison precision#102sebastianbergmann merged 1 commit intosebastianbergmann:3.0from mvorisek:fix_float_precision
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-100and1E-200were considered the samethis PR removes the
DoubleComparatorcompletely, if number is supposed to be compared unexactly, delta can be passed toNumericComparator