2 lines
573 B
Plaintext
2 lines
573 B
Plaintext
A `for` loop with a counter that moves in the wrong direction, away from the stop condition, is not an infinite loop. Because of https://en.wikipedia.org/wiki/Integer_overflow#:~:text=The%20most%20common%20result%20of%20an%20overflow%20is%20that%20the%20least%20significant%20representable%20digits%20of%20the%20result%20are%20stored%3B%20the%20result%20is%20said%20to%20wrap%20around%20the%20maximum[wraparound], the loop will eventually reach its stop condition, but in doing so, it will probably run more times than anticipated, potentially causing unexpected behavior.
|