With lists of unequal length, I've had good luck with
   listA e. listB
and
   listA e.~ listB
to indicate differences and
   listA -. listB
and
   listA -.~ listB
to show the differing items.

On Tue, Jul 12, 2011 at 7:03 AM, Ric Sherlock <[email protected]> wrote:

> listA ~: listB
> will produce a boolean list you can use to target the items that aren't
> equal
>
> Is your problem with counting non-zero list items to do with tolerance
> or simply how to do it
> +/ listA ~: 0    NB. counts non-zero list items
>
> On Tue, Jul 12, 2011 at 10:48 PM, David Vaughan
> <[email protected]> wrote:
> > What is the best approach to compare the contents of lists? What I want
> to do is the equivalent of:
> >
> > if (listA[i]!=listB[i])
> >
> > In C.
> >
> > Also I've been having trouble trying to count nonzero list items.
> >
> > Thanks.
> >
> > ___________________________
> >
> > David Vaughan
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> 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

Reply via email to