On my system, "day" takes about twice as long as "todayno" but uses
about 20% less space on 1000 dates.
On 5/30/07, Ralph G Selfridge <[EMAIL PROTECTED]> wrote:
Actually I was very interested in the difference between the two
algorithms, in no way does it matter whether you use day or todayno.
Here is a version that will run on arrays, and it appears, with my ts, to
be 4-5% faster, and a bit less space than todayno. If you compare with
todayno remember that day 1 1 1 returns 1
day=: 3 : 0
0 day y
:
if. x do. y=.0 100 100#:y end.
g=.(365&* + -/@:(<.@:((4 100 400%~/]))))<:@{."1 y
m=.((2<1{"1 y)*(0-/ .=4 100 400|/ {."1 y)) + ((1{"1 y){0 0 31 59 90 120
151 181 212 243 273 304 334) My e-mail writer breaks lines, stick
this
on the end of m=.
g +m+{:"1 y
)
On Wed, 30 May 2007, Chris Burke wrote:
>
> Once you convert day to permit an array of dates, then there is not much
> difference between this and todayno. Let me know if you can speed this
> up significantly.
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm