🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9314

Re: Calendar Functions (simpler leap year calculation)

#9314
From: P. D. Guthrie
Date: Sun, 14 Sep 1986 21:09
10 lines
907 bytes
>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)
Technical Details
Message-ID: <886@ihdev.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!caip!princeton!allegra!ulysses!mhuxr!mhuxt!houxm!ihnp4!ihdev!pdg
References: <206@cascade.STANFORD.EDU> <1229@loral.UUCP> <34@vianet.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!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