I ran a test for a few million lookups using i. on floating point numbers
and found no discrepancy but I created "sl" by a random selection from
"fl", so this may not properly replicate your issue.

This was in the new J v. 8.04.

On Wed, Jul 1, 2015 at 3:59 PM, <[email protected]> wrote:

> Can you give an example, exactly?
>
> I think this would fail only if some sl is not found in fl.
>
> Henry Rich
>
> ---- John Baker <[email protected]> wrote:
> > I have observed that this sometimes fails
> >
> > fl=.  78.9999 .....  some floating list
> > sl=. 78.9999 .... some subset of (fl)
> >
> > (666.666 #~ #sl) (fl i.  sl) } fl  NB. searching floats
> >
> > where this always works
> >
> > (666.666 #~ #sl) ((<.fl) i. <. sl) } <. fl  NB. searching integers
> >
> > When I came across this I thought this could be fixed by comparison
> > tolerance.
> >
> > (666.666 #~ #sl) (fl (i. !.0) sl) } fl
> >
> > but no luck.
> >
> > Either this is a bug in J or I am not properly setting comparison
> tolerance
> > to 0.
> >
> >
> > Floating point - one of life's more intractable necessary evils.
> >
> > --
> > John D. Baker
> > [email protected]
> > ----------------------------------------------------------------------
> > 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to