tol =. 0.001
   neareq =. tol >!.0&| -
   1 neareq 1.01
0
   1 neareq 1.00001
1

The original post on this mentioned complex numbers.  There the |
involves a square root, which could be avoided by

   neareq =. (*:tol) >!.0 (*+)@:-

Henry Rich

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of greg heil
> Sent: Monday, May 29, 2006 12:42 PM
> To: Programming forum
> Subject: Re: [Jprogramming] Equal tolerance fit conjunction -- again
> 
> Roger Hui <[EMAIL PROTECTED]> wrote:
> > I should point out that tolerance in J is working as it 
> should:  The dictionary specifies a relative tolerance and 
> that is what the implementation provides.
> 
> i crashed into this issue in 1994, and Roger patiently gave the same
> answer. If anyone has an idiom to give absolute tolerance i would be
> interested.
> 
> ~greg
> ----------------------------------------------------------------------
> For information about J forums see 
> http://www.jsoftware.com/forums.htm

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

Reply via email to