News for hackers. Stuff that matters.
Re:Efficient C Tip – use the modulus (%) operator with caution by caf on Tuesday February 08, 2011 @08:38PM (#2195832)
In any case, once you've done the division, the remainder is practically free; the article is basically an illustration of how bad the compilers in question are at spotting this fact.

This is probably the rationale behind the standard div() function, that calculates division and modulus together - it should make it easier for less sophisticated compilers to take advantage of this.

There are no comments on this comment yet.