[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] 1904 (was Cookie Expiry question)



 > 1904 actually. When a Mac rolls back to 0 it hits Dec. 31, 1904.
 > The story goes that this date "looked good" for some numerological reason
 > :-)

The numerology involved is, of course, that of leap years.  As long as
you're within the range 1901 to 2099, the rule "if it's divisible by
four, it's a leap year" is sufficient.  As soon as you add either 1900
or 2100 to the range, you have to use the more complex (and more
correct) rule "if it's divisible by four it is a leap year, unless
it's divisible by 100 in which case it isn't, unless it's also
divisible by 400 in which case it is again"...  (or you treat those
years as special cases, which is almost as bad).  And starting at a
multiple of four makes those "divisible by 4" tests easier
(comparisons to zero being a more basic CPU operation than comparisons
to 1, 2, or 3).

-- 
Michael A Stoodt  [MaS]            |
mstoodt@umassd.edu                 | No boom _today_.  Boom tomorrow.
Comp&InfoSci, UMassDartmouth       | There's always a boom tomorrow.
mumble mumble disclaimer mumble... |

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org