3 ms·
The unintuitive thing about this choice is that "for i = n,m" calls the loop body "m-n+1" times. The "for (i = n; i < m; i++)" does it "m-n" times. A more elab
by qznc 14y ago
The unintuitive thing about this choice is that "for i = n,m" calls the loop body "m-n+1" times. The "for (i = n; i < m; i++)" does it "m-n" times.
A more elaborate argument: http://www.cs.utexas.edu/~EWD/transcriptions/EWD08xx/EWD831.html http://www.cs.utexas.edu/~EWD/transcriptions/EWD08xx/EWD831....