Drop wrong float comparison using PHP_FLOAT_EPSILON
discussion https://github.com/phpstan/phpstan-src/pull/2358#discussion_r1174422409
PHP_FLOAT_EPSILON is small but still much larger than "small floating point values" - https://3v4l.org/570q1
abs($this->value - $type->value) < PHP_FLOAT_EPSILON condition for small numbers always wrongly returned true, === is the only valid cmp as long as both left/right side of the operator are of type float
This pull request has been marked as ready for review.
These changes need tests to see what they’re sctually fixing.
This pull request has been marked as ready for review.
TIL that '1e-50' is a numeric string. I guess its super rare, but we might have some logic in the codebase which does not allow - in numeric strings.
Thank you.