Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!smurf!artcom0!hb.maus.de!ms.maus.de!Kai_Henningsen From: Kai_Henningsen@ms.maus.de (Kai Henningsen) Newsgroups: comp.lang.pascal Subject: Re: Leap year function Message-ID: <15921@ms.maus.de> Date: 20 May 91 19:35:00 GMT Distribution: world,comp Organization: Maus Mailbox Netz - UUCP-Gateway Bremen Lines: 18 neile @ hls.com schrieb am Fr 17.05.1991, 13:48 A16170@SUB in Cl-Pascal: ne>The test for a leap year is simple; year mod 4 = 0. There is no reason to ne>add complexity as indicated in other postings. This, of course, assumes that you will never be interested in years before 1901 or after 2099. I would prefer not to make such an assumption. Then, the (still simple) rule is of course (year mod 4 = 0) and ((year mod 100 <> 0) or (year mod 400 = 0)) That's for the Gregorian calender. Once you leave *that* ground, it gets complicated. -- Kai Henningsen Internet: kh@ms.maus.de Muenster UUCP: any_backbone_that_knows_domains!ms.maus.de!kh Germany Fido: kh%maus ms, 2:242/2.6 or Kai Henningsen, 2:242/2.244