Live data from Hacker News

A faster is_leap_year function (full-range, C++)

benjoffe.com

1–3 of 3 posts

Re: A faster is_leap_year function (full-range, C++)

#2
In this article I present a new faster full-range function to calculate whether a year is a leap year. This type of calculation is a fundamental date library utility, it is used all over the place: validating and parsing dates, determining the Nth last weekday of a month, handling month overflow/underflow when adjusting the day, etc.

The article outlines the technique, shows related developments before and after its creation, and includes an interactive, human-verifiable "proof".