Re: Leap Years
- Posted by MAP <ddhinc at ALA.NET> Mar 02, 1998
- 647 views
Joshua Milligan wrote: > > Does anyone have an algorithm for determining whether or not a given year is > a leap year? (Sorry, this has probably been asked and answered before.) > > Thanks for your help, > Joshua Milligan ------------------------------------------------------------------------------ -- leap year is any year divisible by 4, as long as... -- it is not divisible by 100 unless it's divisible by 400 -- as well. function leap_year (atom year) -- returns 1 for leap years, 0 for non-leap years return (remainder(year, 4) = 0) and (remainder(year, 100) != 0) or (remainder(year, 400) = 0) end function ------------------------------------------------------------------------------ Hope this helps, Christopher D. Hickman