Interestingly enough if I use = in place of ~: it runs very slightly
faster, space is the same.
On Fri, 29 Dec 2006, Roger Hui wrote:
With the noun verb verb forks new in J6.01,
the expressions can be simplified from
m11 =: 0: ~:/ .= 4 100 400"_ |/ ]
m11_4k=: 0: ~:/ .= 4 100 400 4000"_ |/ ]
to
m11 =: 0 ~:/ .= 4 100 400 |/ ]
m11_4k=: 0 ~:/ .= 4 100 400 4000 |/ ]
----- Original Message -----
From: Devon McCormick <[EMAIL PROTECTED]>
Date: Friday, December 29, 2006 9:08 am
Subject: Re: [Jprogramming] Re: Leap Year
Someone I know once calculated that there should be a 4000-year
correctionas well, to whit:
there is an exception (flip parity) to the "divisible by 400"
exception if
the year is divisible by 4000.
However, this assumes that the year calculation is purely
mathematical when
in fact it is
ultimately political.
The J expression "m11" is nicely succinct and easily extendible if
we wish
to add this additional
exception:
m11=: 0: ~:/ .= 4 100 400"_ |/ ]
m11_4k=: 0: ~:/ .= 4 100 400 4000"_ |/ ]
m11 1900 1901 1999 2000 2003 2004 3600 3999 4000 4004
0 0 0 1 0 1 1 0 1 1
m11_4k 1900 1901 1999 2000 2003 2004 3600 3999 4000 4004
0 0 0 1 0 1 1 0 0 1
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm