The year to to be tested.
foreach (year; [1, 2, 100, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010]) { assert(!yearIsLeapYear(year)); assert(!yearIsLeapYear(-year)); } foreach (year; [0, 4, 8, 400, 800, 1600, 1996, 2000, 2004, 2008, 2012]) { assert(yearIsLeapYear(year)); assert(yearIsLeapYear(-year)); }
Whether the given Gregorian Year is a leap year.