Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Efficient C Tip – use the modulus (%) operator with caution. Parent comment
Ah, I missed that. Even on normal processors, for the following:
int div60(int i) { return i / 60; } int mod60(int i) { return i % 60; }
There are no comments on this comment yet.
Ah, I missed that. Even on normal processors, for the following:
gcc uses one multiplication and some shifts/additions for div60() and two multiplications and some shifts/additions for mod60().