Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!princeton!allegra!ulysses!mhuxr!mhuxt!houxm!ihnp4!ihdev!pdg From: pdg@ihdev.UUCP (P. D. Guthrie) Newsgroups: net.lang.c Subject: Re: Calendar Functions (simpler leap year calculation) Message-ID: <886@ihdev.UUCP> Date: Sun, 14-Sep-86 17:09:14 EDT Article-I.D.: ihdev.886 Posted: Sun Sep 14 17:09:14 1986 Date-Received: Mon, 15-Sep-86 20:36:56 EDT References: <206@cascade.STANFORD.EDU> <1229@loral.UUCP> <34@vianet.UUCP> Reply-To: pdg@ihdev.UUCP (55224-P. D. Guthrie) Distribution: net.lang.c Organization: American Nasal Amputation Centre Lines: 10 >Or if you want a simple cpp macro: > >#define isleapyear(year) ((year)%4) > >Bob Devine Or if you want a complex cpp macro to return the number of days in a year...... #define num_day(x) ((x)%4 ? (x)%100 ? (x)%400 ? 366 : 355 : 356 : 355)