June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -1,5 +1,4 @@
leap(y) = y%4==0 && (y<1582 || y%400==0 || y%100!=0)
isleap(yr::Integer) = yr % 4 == 0 && (yr < 1582 || yr % 400 == 0 || yr % 100 != 0)
# some tests
@assert all([leap(yr) for yr in [2400, 2012, 2000, 1600, 1500, 1400]])
@assert all([~leap(yr) for yr in [2100, 2014, 1900, 1800, 1700, 1499]])
@assert all(isleap, [2400, 2012, 2000, 1600, 1500, 1400])
@assert !any(isleap, [2100, 2014, 1900, 1800, 1700, 1499])