Task

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



See also

 Leap year (wiki)


leapyearp(year) := is(mod(year, 4) = 0 and
   (mod(year, 100) # 0 or mod(year, 400) = 0))$