c# - Is there a situation in which using `i <= 2` in place of `i < 3` in loops would cause a change in behavior of the loop? -


this silly question. lot of data extrapolation for loops in applications. in cases tend find i <= 2 easier read/interpret i < 3. based on know should mean same thing, i'm wondering if there special cases evaluated differently when used in for loop. example, if used ++i instead of i++.

provided i integer, expressions i<=2 , i<3 should identical in function.
(they may different in terms of speed performance)

if i has type float, double, decimal, or related, value of 2.3 fail first test, pass second test.

if overload operator< or operator<=, make possible.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -