On Sun, Apr 20, 2014 at 3:27 PM, Henry Rich <henryhr...@nc.rr.com> wrote:

> This has trouble when the numbers are close.
>
>    3 ((]*=) + - % ^.@:%) 3.000000000000001
> 5.66667
>    3 ((]*=!.0) + - % ^.@:%) 3.000000000000001
> 2.66667
>

That's a good point.

I didn't need =!.0 for the earlier version (which had the NaN problem when
both args were 0) but the increased robustness of Roger's version looks
like it wants a more exact form of equality.

If I have time, I'll take a look at how stable this is over a wide range of
values (and small epsilons).

Thanks,

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

Reply via email to