Calendar Functions (simpler leap year calculation)

P. D. Guthrie pdg at ihdev.UUCP
Mon Sep 15 07:09:14 AEST 1986


>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)



More information about the Comp.lang.c mailing list