4 ms·
I assume the OP would be using llvm, as this is the default OSX compiler, and the gcc command is usually just an alias or link to clang. In real world code thi
by keeperofdakeys 14y ago
I assume the OP would be using llvm, as this is the default OSX compiler, and the gcc command is usually just an alias or link to clang.
In real world code this kind of optimisation is designed to catch things programmers aren't aware of, for a large decrease in required computation. In this case, sum(1 .. n) == n*(n+1)/2.