lib.rs
/*
Info about year lengths: https://en.wikipedia.org/wiki/Year#Summary
Mean tropical year is about 365.24219: http://adsabs.harvard.edu/pdf/1999A%26A...341..318M
The reason for Gregorian Calendar rules for leap days: https://blog.plover.com/calendar/leapday.html
*/
pub fn is_leap_year(year: u64) -> bool {
// Check divisibility. Panics if `b` is `0`.
let a = move |b: u64| year % b == 0;
a(4) ^ a(100) ^ a(400) ^ a(3200) ^ a(80000)
}