You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Only allow loose comparison with numeric operands #40
Similar to arithmetic operators (+/-/*///**/%), loose comparison operators should only be used for numeric values. This is true for ==, !=, <, >, <=, >= and <=>.
Using any of these operators for non-numeric values may lead to unexpected results.
The option to disallow == and != completely doesn't cover the full problem as other comparison operators are still allowed and might give unexpected result. It also disallows cases where you do want to use == because you're comparing numbers.
Given #38, the ==, !=, >= and <= should also not be used if both parts are floats. This is already covered by that PR but could be covered by this test instead.
Activity
jasny commentedon Oct 5, 2018
This supersedes #12. That ticket fails to properly identify and describe the problem.
jasny commentedon Oct 5, 2018
Given #38, the
==,!=,>=and<=should also not be used if both parts are floats. This is already covered by that PR but could be covered by this test instead.jasny commentedon Oct 20, 2018
Also see