Return-Path: Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Delivered-To: mailing list dev@apr.apache.org Received: (qmail 36555 invoked from network); 1 Feb 2001 23:30:08 -0000 Received: from 24-148-31-193.na.21stcentury.net (HELO newton.collab.net) (24.148.31.193) by h31.sny.collab.net with SMTP; 1 Feb 2001 23:30:08 -0000 Received: (from sussman@localhost) by newton.collab.net (8.11.1/8.11.1) id f11NUXm66284; Thu, 1 Feb 2001 17:30:33 -0600 (CST) (envelope-from sussman) To: cliffwoolley@yahoo.com Cc: cmpilato@collab.net, dev@apr.apache.org Subject: Re: [patch] Time fixes for Win32 References: <20010201232227.3719.qmail@web3202.mail.yahoo.com> From: Ben Collins-Sussman Date: 01 Feb 2001 17:30:33 -0600 In-Reply-To: Cliff Woolley's message of "Thu, 1 Feb 2001 15:22:27 -0800 (PST)" Message-ID: <867l3ac76u.fsf@newton.collab.net> Lines: 17 X-Mailer: Gnus v5.7/Emacs 20.6 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Cliff Woolley writes: > --- cmpilato@collab.net wrote: > > +/* Leap year is any year divisible by four, but not by 100 unless also > > + * divisible by 400 > > + */ > > +#define IsLeapYear(y) ((!(y % 4)) ? (((!(y % 400)) && (y % 100)) ? 1 : 0) : 0) > > + > > If y is divisible evenly by 400, it's automatically divisible by 100... you don't need to > check both. =-) It's also divisible by 4, but that's not the point. :) I think the the rule is: every fourth year is a leap year, BUT, every century is not; BUT; every fourth century *is* a leap year. We've got two levels of override here.