Tom Kauffman wrote:
But we computer types have things screwed up based on the two-digit year, and thus the Y2K problem. And even some of the code that *looks* like it will handle Y2K properly is broken - many people do not realize that 2000 is a leap year. They look at the statement that 'any year divisible by 4 is a leap year, unless it's a century' and don't realize that every fourth century is also a leap year.
When I learned programming (many years ago in COBOL) we were taught a very simple and easy to remember rule for determining if a year is a leap year. A year is a leap year if divisible by 4. However if divisible by 100 then it is only a leap year if also divisible by 400. and I derived the following C macro to test for leap years from this rule. #define isleap(x) (x % 4 ? 0 : x % 100 ? 1 : x % 400 ? 0 : 1) Steve Crane stevec@netlane.com <A HREF="http://www.datapro.co.za/~stevec"><A HREF="http://www.datapro.co.za/~stevec</A">http://www.datapro.co.za/~stevec</A</A>> - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e Check out the SuSE-FAQ at <A HREF="http://www.suse.com/Support/Doku/FAQ/"><A HREF="http://www.suse.com/Support/Doku/FAQ/</A">http://www.suse.com/Support/Doku/FAQ/</A</A>> and the archiv at <A HREF="http://www.suse.com/Mailinglists/suse-linux-e/index.html"><A HREF="http://www.suse.com/Mailinglists/suse-linux-e/index.html</A">http://www.suse.com/Mailinglists/suse-linux-e/index.html</A</A>>