Ben Collins-Sussman [EMAIL PROTECTED] writes:
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.
Yep, that's the rule as I've been taught it too.
--- [EMAIL PROTECTED] 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
Cliff Woolley [EMAIL PROTECTED] writes:
--- [EMAIL PROTECTED] 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,
--- Cliff Woolley [EMAIL PROTECTED] wrote:
If y is divisible evenly by 400, it's automatically divisible by 100... you
don't need
to check both. =-)
That's what I get for talking before I think... I guess you actually DO have to
check,
since you have to be sure that if it's not divisible