I need to compare floats (complex) with more lenient
tolerance, that is numbers a bit farther apart would
return equal. 

In particular, I need to compare with 0, so that
for 0e_11 it returns 1 and for 0e_9 it returns 0.

>From the dictionary,
  http://www.jsoftware.com/books/help/dictionary/d000.htm
"comparison is made with a tolerance t , normally 2 to 
the power _44". But

   0 = 2^_44
0
   0 = 2^_60
0
   0 = 2^_20
0

So how does this example relate to the rule above?

It continues, "but also controlled by the fit conjunction !. , 
as in x=!.0 y . Formally, x=y is 1 if the magnitude of x-y does 
not exceed t times the larger of the magnitudes of x and y ."

With zero and positive x we have

   (|x-0) <: t*x
   x <: t*x
   1 <: t

This doesn't make sense. Can I compare tolerantly
with zero at all?


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to