Navigation Menu+

Algorithmically Speaking – February 29, 2008

Posted on Feb 29, 2008 by in Photo Blog | 0 comments

oldluggage.jpg

There’s a tradition in many places in the English-speaking world that women may propose marriage only on Leap Day. There’s probably another tradition that men have their sturdy travel suitcase pre-stocked and ready to bolt at a moment’s notice when February 29th rolls around. In case you need to be prepared, here’s the programming algorithm for leap years:
if (year modulo 4 is 0) and ((year modulo 100 is not 0) or (year modulo 400 is 0))
then leap
else no_leap

Submit a Comment

Your email address will not be published.