Task

Determine whether a given year is a leap year in the Gregorian calendar.



See also

 Leap year (wiki)


/**
 <doc><h2>Leap year, in Neko</h2></doc>
**/
 
var leapyear = function(y) return ($not(y % 4) && $istrue(y % 100) || $not(y % 400))
 
var tests = $array(2000, 1997, 1996, 1994, 1990, 1980, 1900)
var cnt = $asize(tests)
while (cnt -= 1) >= 0 $print(tests[cnt], if leapyear(tests[cnt]) " is" else " is not", " a leapyear", "\n")