3 ms·
If you read the comments, you'll see that the "wasteful" method is actually the cheapest computationally.
by jpatokal 8y ago
If you read the comments, you'll see that the "wasteful" method is actually the cheapest computationally.
- chris_mc 8y agoI'm responding to the general lack of concern by the commenter above and most engineers I know. You and this other guy commenting are missing the point, I'm not talking specifically about this algorithm, but about engineers in general who don't care about wasted cycles.
- tomc1985 8y agoYes but that's the entire point of these comments, wasting cycles is a great optimization but unless the goal is purely intellectual exercise, you lose more time with expensive trig functions. The real world favors the naive approach, in this context + case.