What is Leap Year ?
Is it the year with Feb 29 ?
We can see what Wikipedia says about leap year
February 29 is a date that usually occurs every four years, and is called leap day. This day is added to the calendar in leap years as a corrective measure, because the earth does not orbit around the sun in precisely 365 days.
A leap year (or intercalary or bissextile year) is a year containing one additional day (or, in the case of lunisolar calendars, a month) in order to keep the calendar year synchronized with the astronomical or seasonal year
How to check a year is leap or not ?
is_leap_year = ( year modulo 4 is 0 ) and ( ( year modulo 100 is not 0 ) or ( year modulo 400 is 0 ) )
No comments:
Post a Comment