6 ms·
Using overflow operators instead of the ones that check for that each iteration.
by viktorcode 9mo ago
Using overflow operators instead of the ones that check for that each iteration.
- Someone 9mo agoReading https://github.com/niklas-heer/speed-comparison/blob/master/src/leibniz.swift https://github.com/niklas-heer/speed-comparison/blob/master/..., I think the only overflow checks could be in for i in 2...rounds+2 and I would hope/expect the compiler to be smart enough to know that it only has to check “rounds+2” once there. Swift isn’t exactly new anymore, and it’s supported by a large company. What do I overlook?
- pizlonator 9mo agoThere’s no way overflow checks are responsible for that enormous speed difference from C
- deleted 9mo ago[deleted]