Hacker News new | ask | show | jobs
by lifthrasiir 2537 days ago
> The easiest way to code it is to just precompute the year % 400 table and report the results.

If you are interested, Chrono [1] internally uses the exact table. Constants there refer to dominical letters [2].

[1] https://github.com/chronotope/chrono/blob/a4488007272569f752...

[2] https://en.wikipedia.org/wiki/Dominical_letter