I am following \"The Art and Science of Java\" book and it shows how to calculate a leap year. The book uses ACM Java Task Force\'s library.
Here is the code the boo
if ((year & 3) == 0 && ((year % 25) != 0 || (year & 15) == 0)) { /* leap year */ }
This is an excerpt from my detailed answer at https://stackoverflow.com/a/11595914/733805