RosettaCodeData/Task/Leap-year/GAP/leap-year.gap
2023-07-01 13:44:08 -04:00

8 lines
197 B
Text

IsLeapYear := function(n)
return (n mod 4 = 0) and ((n mod 100 <> 0) or (n mod 400 = 0));
end;
# alternative using built-in function
IsLeapYear := function(n)
return DaysInYear(n) = 366;
end;