Possible duplicate:
Is counting faster?
I read a book in C ++ called C ++ for You ++ . (I have a 1998 edition.)
The chapter on Monte Carlo methods has a code snippet used to calculate certain integrals:
for(n = nPoints; n > 0; n--) {
My question is not about the code, but the comment:
A cycle that drops to 0 is somewhat more efficient.
It's true?????
Why is a cycle going to zero more efficient than an ascending cycle?
n , loop counter, not even used in a loop!
Again, this is not an urgent issue. I am just curious. Perhaps I came across something to make my programs a little more efficient!
eboix source share