Is 2008 a leapyear? ... almost a trivial question.
Anthony Camacho (I believe Manchester 1986) has provided an interesting
paper on a couple of subjects, among others the swastika and the
leapyear.
Despite it's relative triviality I love the APL/J algorithm.
Here is the J-version:
Are the years in arg leapyears?
2|+/0=4 100 400|/ arg
How many days in the years in arg
365+2|+/0=4 100 400|/arg
How many days in February of the years in arg
28+2|+/0=4 100 400|/ arg
Selecting the leapyears from the years in arg
(2|+/0=4 100 400|/ arg) # arg
Lovely!
An article on the subjects from some 10 years ago (forget the language -
it's
Dutch)
http://www.ganuenta.com/leap.pdf
_________________________________________________________
Jan Karman
http://www.ganuenta.com