←back to thread

420 points gnabgib | 1 comments | | HN request time: 0.236s | source
Show context
usr1106 ◴[] No.44001491[source]
Interesting. In one place the author argues: 0 is missing, but we already know...

The is no year 0, it goes 1 BC, 1 AD. So testing whether 0 is a leap year is moot.

replies(4): >>44001514 #>>44001606 #>>44001960 #>>44002001 #
1. JdeBP ◴[] No.44001606[source]
Go back to the start of the article, and you'll find that using the proleptic Gregorian calendar with astronomical year numbering is a premise for the algorithm.

Without that design constraint, testing for leap years becomes locale-dependent and very complex indeed.