HP3000-L Archives

November 1997, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Wed, 12 Nov 1997 11:33:54 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (19 lines)
Art wrote:

>Ok for those of us who don't know 'C'?
>
>     Why isn't it accurate Glenn?
>
<snip>
>
> #define leap_year(yy)    ((yy & 3) == 0 ? 1 : 0)

This define only handles the 'evenly divisible by 4' part of the test.
Masking the low-order 2 bits from a number is equivalent to getting
the remainder after dividing by 4 - if the result is zero, then the
number is evenly divisible.

------------
Randy Medd
Telamon, Inc.

ATOM RSS1 RSS2