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 on the front page, newest first. Scroll down to watch the site change over time.
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.