A leap year check in three instructions(hueffner.de)
386 points by gnabgib | 130 comments
Blog post by Falk Hüffner explaining a leap year check for years 0–102499 using a multiply, mask, and compare in about three CPU instructions.
1 story tagged integer-arithmetic, newest first.
386 points by gnabgib | 130 comments
Blog post by Falk Hüffner explaining a leap year check for years 0–102499 using a multiply, mask, and compare in about three CPU instructions.