Calendar/
leapyr.pro
determine whether the input year is a leap year or not
Very useful for finding number of days in a year.
eg. NUM_DAYS_IN_YR = 365 + leapyr(year)
leapyr
Calendar
result = leapyr(year)
Return value
0 then not a leap year, 1 then year is a leap year
with the same number of elements than year.
Parameters
year
in
required
type: scalar or array
year to be tested as a leap year.
Examples
IDL> result = leapyr(2000)
Version history
Version
$Id: leapyr.pro 231 2007-03-19 17:15:51Z pinsard $
History
Originally Written by: Trevor Harris, Physics Dept., University of Adelaide,
20/09/88
November 2004: correction for century years... S. Masson;
Every year divisible by 4 is a leap year.
But every year divisible by 100 is NOT a leap year
Unless the year is also divisible by 400, then it is still a
leap year.
This means that year 1800, 1900, 2100, 2200, 2300 and 2500 are
NOT leap years, while year 2000 and 2400 are leap years.
+ supress the automatic change 89 -> 1989
June 2005 update for new commons, Sebastien Masson.
Other attributes
Uses routines
cm_4cal
Produced by IDLdoc 2.0.