On Fri, May 2, 2008 at 2:20 AM, bill lam <[EMAIL PROTECTED]> wrote:
> So they make 2%0.00000057 > 3 million shirts daily, every day. ;-)

Not if those floating point numbers are times packed as
YYYYMMDD.hhmmss...

In this case, 0.00000057 would be slightly over half a second.

Anyways, I think that he should be using something like this:
   require'dates'
   ts4shirt=: 0 tsrep (6{.2e3)+(0,5#100) (#:!.0) 1e6 * _2e7 + ]
   shirt4ts=: 2e7 + 1e_6 * (0,5#100) #. (6{._2e3) + 1 tsrep ]

Basically: convert to a more compact format, temporarily
shifting the numbers closer to zero during part of the pack/unpack
process so that you do not lose too much precision to floating
point arithmetic.

An even better approach might be to capture that original
time stamp as character data, rather than using #:

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to