Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!lth.se!newsuser From: d89mb@efd.lth.se (Magnus Bodin) Newsgroups: comp.lang.pascal Subject: Re: Leap year function Message-ID: <1991May22.061308.8736@lth.se> Date: 22 May 91 06:13:08 GMT References: <26912@adm.brl.mil> <1991May17.074806.130@hls.com> Sender: newsuser@lth.se (LTH network news server) Reply-To: d89mb@efd.lth.se (Magnus Bodin) Organization: Institute of Tychology, Sweden Lines: 30 >>The test for a leap year is simple; year mod 4 = 0. There is no reason to >>add complexity as indicated in other postings. >> >>Neil Everhart >Isn't there something odd about the centuries and millenia? Yes, sort of. Leap year occurs every year that is even dividable by 4, eg 1984, 1988, 1992... But, it does NOT occur when the year is even dividable by 100, eg. 1800, 1900 UNLESS it's not even dividable by 400 AS WELL... Therefore 2000 is a leap year. If you just divide by 4, you won't have wrong until 2100. Takelr|, Magnus -- Magnus Bodin "Nec fasces, nec opes, Institute of Tychology, sola artis sceptra perennant" Box 5127, 220 05 Sweden (Tycho Brahe, Stj{rneborg 1584)