News for hackers. Stuff that matters.
Re:How to compare floats in Python by sacrosancty on Wednesday March 30, 2022 @02:14PM (#30858776)
I'm not comfortable they recommend using an epsilon (isclose()). That's begging for mysterious bugs when the numbers are near the threshold. Better to just not compare floats for equality except when you're confident they can be exactly equal. Usually, that doesn't make sense, any more than comparing measurements of weight for equality.

There are no comments on this comment yet.