Rather than using an epsilon for float comparison, can you reliably compare two floats for equivalency by rounding them to the desired precision?
For example:
round($float, 3) === round($otherFloat, 3)
Rather than using an epsilon for float comparison, can you reliably compare two floats for equivalency by rounding them to the desired precision?
For example:
round($float, 3) === round($otherFloat, 3)
No. If your numbers are just barely on opposite sides of the value where the function will round up instead of down (a half-integer if you're round to the nearest integer), then they will round to different numbers no matter how close together they are.