>I'm sorry if a 1300% increase in speed isn't considered better in your opinion
Certainly not in this case. You failed to describe exactly what you meant by saying "best" (assuming that "best" was execution speed), you failed to compare two equivalent solutions to prove your assertion, and you failed to compare the execution speeds correctly. Therefore your premise was subjective, your test was flawed, and your conclusion was biased.
Show me a legitimate 1300% increase in speed and I'll take you more seriously. :icon_rolleyes:
>This is the latest code for the efficiency test, and you will find the results to be quite identical.
Not when taken out of the timing loop. The timing loop should be only for timing, but your "non div + mod calculations" require it for correct behavior. These two snippets are equivalent without the timing loop:
int iX = i % ROW;
int iY = i / ROW;
int iX = 0;
int iY = 0;
for ( int j = 0; j < i; j++ ) {
if ( ++iX >= ROW ) {
++iY;
iX = 0;
}
}
That's what I mean by identical results. If you remove the timing loop and run the code with any value of i, and the result is the same. In your code the result is only the same when run with consecutive values of i, which means your method is dependent on the timing loop while the method you …