News for hackers. Stuff that matters.
Re:Comparing Floating-Point Numbers Is Tricky by bubblethink on Thursday March 30, 2017 @09:09PM (#14000457)
Why is that so ? If you can do a<b and a>b reliably, you can get equality as !(a<b || b<a). Inequality has the same issues for very close values.
Re:Comparing Floating-Point Numbers Is Tricky by greglindahl on Thursday March 30, 2017 @09:15PM (#14000487)
Try putting NaN into your equation: not equal to itself.