3 ms·
int const N = 1000000000; for (x0 = 0; x0 != N; x0++) for (x1 = 0; x1 != N; x1++) ... for (x9 = 0; x9 != N; x9++) -- do something --; R
by jmull 2y ago
int const N = 1000000000;
for (x0 = 0; x0 != N; x0++)
for (x1 = 0; x1 != N; x1++)
...
for (x9 = 0; x9 != N; x9++)
-- do something --;
Rule 1 would disallow this. Probably other rules as well, depending on the details for your code analysis tools.
Also the article seems to imply the rule about recursion was about knowing your program would terminate, but the rationale from the rules says it's about verifying execution is bounded. That's a somewhat different concept. With recursive calls you have the stack to consider.