Definition: | bool b = is_leap_year(integer y) |
Description: | Returns true (1) if the year is a leap year, false (0) otherwise. |
Comments: |
Uses the proper rules for years divisible by 4, 100, and 400.
Obviously this functionality is required as part of date(), and has been made available for general use. Not suitable for use with years prior to the introduction of the Gregorian calendar (1752). |
Example: |
?{is_leap_year(2015),is_leap_year(2016),is_leap_year(1900),is_leap_year(2000),is_leap_year(2004)} -- prints { 0 , 1 , 0 , 1 , 1} |
See Also: | date, time |