News for hackers. Stuff that matters.
Re:99% code coverage (2017) by nathan_f77 on Wednesday January 16, 2019 @07:13AM (#18920143)
'<' versus '<=' can be very important, and it can cause severe bugs when dealing with things like array indices or financial data.

There are some cases where it's not a big deal. '<' and '<=' can be interchangeable if one or both of the values are a rough estimate. One example would be comparing two images and doing something if they are a close match. It might not be too bad if you use `<= 0.995` instead of `< 0.995` when checking the percentage.

Some other examples might involve accelerometer data, pressure sensors, GPS boundaries, debounce algorithms, animations, etc. But I think it's just a good habit to write test cases that test those boundary values.

Re:99% code coverage (2017) by progval on Wednesday January 16, 2019 @03:17PM (#18924643)
Basically, it depends on whether we're dealing with floats or integers.