Is it faster to count down than it is to count up?
- by Bob
Our computer science teacher once said that for some reason it is more efficient to count down that count up.
For example if you need to use a FOR loop and the loop index is not used somewhere (like printing a line of N * to the screen)
I mean that code like this :
for (i=N; i>=0; i--)
putchar('*');
is better than:
for (i=0; i<N; i++)
putchar('*');
Is it really true? and if so does anyone know why?