3 ms·
7 times through the loop is 6 iterations. It’s the first time that is iterated, repeated.
by jonsen 6y ago
7 times through the loop is 6 iterations.
It’s the first time that is iterated, repeated.
- susam 6y agoIsn't the first pass through the body of the loop also often colloquially called "the first iteration"?
- jonsen 6y agoYes, but look at your example here. The value is decremented to -6 after the 6. iteration, right? That’s what Thorrez is saying at the start of this thread.
- susam 6y agoThank you for elaborating the terminology issue in your comments. I do see Thorrez's point now. If we consider an iteration to be complete when i-- (the iteration expression) has been completed execution, then yes, the value of the variable i is decremented to -6 when the 6th iteration completes. In fact, the value of the variable i is decremented to -7 when the 7th iteration completes. The language used in this blog post regarding the iterations (which is also quoted by Thorrez) is indeed sloppy. I will update it soon and fix it. Thank you, jonsen and Thorrez, for paying attention to the details!