Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!psuvax1!rutgers!cmcl2!adm!news From: DAVID@ches.cs.vims.edu Newsgroups: comp.lang.pascal Subject: Re: leap year function Message-ID: <26921@adm.brl.mil> Date: 17 May 91 11:52:26 GMT Sender: news@adm.brl.mil Lines: 19 This should work as a leap year function: function leap(year : integer) : boolean; begin if year mod 100 = 0 then leap := year mod 400 = 0 else leap := year mod 4 = 0 end; This won't work historically, of course, for political and religious reasons. The omission of century years not divisible by 400 was only introduced with the Gregorian calendar in the 1500's. Thus 1700 was not a leap year -- in Roman Catholic countries, but in England and the American colonies, 1700 was a leap year. Russia only adopted the Gregorian calendar this century so they did not miss in 1800 and 1900 either! David Evans david@ches.cs.vims.edu