Task

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



See also

 Leap year (wiki)


let is_leap_year ~year =
  if (year mod 100) = 0
  then (year mod 400) = 0
  else (year mod 4) = 0