I provided a formal proof because I want to leave no
doubt as to the conclusion.  The same answer could 
have been arrived at using various other methods.

One of these is a geometric interpretation:  Given two 
numbers x and y on the complex plane, let p be x or y 
depending on which one has the larger magnitude (farther 
from the origin) and q be the other.  Draw a circle 
centered on p with radius t times |p .  If q is on or 
within the circle, then x=!.t y, equal with tolerance t; 
otherwise not.

If x is 0 and y is not, then y is always the one with
the larger magnitude, and the circle will not contain
the origin if t is less than 1.

The fact that t must be less than 1 is demonstrated
in the tolerant comparison essay.
http://www.jsoftware.com/jwiki/Essays/Tolerant_Comparison
Since I had already cited the essay in this thread
and you yourself had also cited it, I assume you have
read it.  Then I don't understand why you said what you
did in (*).  The essay states and demonstrates that the
tolerance t must be less than 1.  Why do you then bring
up cases where t is greater than 1?



----- Original Message ----- 
From: "Oleg Kobchenko" <[EMAIL PROTECTED]>
To: "Programming forum" <[email protected]>
Sent: Tuesday, May 30, 2006 4:18 AM
Subject: Re: [Jprogramming] Equal tolerance fit conjunction -- again

Intention is an aspect of the actor. And with
multiple actors, such as a system and a user,
the intentions may not coincide.
When building a model of calculation in a partilar 
system the user may obtain unintended results.
This is the meaning of "unintended" that was used.
Another word could be "counterintuitive", that is
contrary to common-sense expectations, but true.

And I am not convinced that it's a simple and
obvious topic, especially that it requires a
formal proof to demonstrate(*). I arrived at
something which seemed a shocking contradiction 
in my original posting.

It's good that J has a built-in tolerant comparison
transpiring to other related operations.
In most other languages there is just a coding
convention not to compare floats for equality.
It's just that it has some pitfalls -- nothing is
perfect -- and my "intention" was to reveal them.

_______
  *) it's not totally clear how it is a consequence
that t must be less than 1. Something is happening
between 1 and 2 as well:
   _1 (1.9 eq) 1
0
   _1 (2 eq) 1
1
   _1 (1.4 eq) 0.5
0
   _1 (1.5 eq) 0.5
1


--- Roger Hui <[EMAIL PROTECTED]> wrote:

> Tolerant equality in J is exactly as it is in SHARP APL.
> Its current definition is derived after some missteps 
> and has been studied by people whose expertise I respect.
> Implementations based on it have been in continuous use
> since 1977.
> 
> It is incorrect to call the exact comparision of 0 an 
> "unintended misidentification".  There is nothing unintended 
> about it.  It is well-known within SHARP APL circles since 
> 1977; I had known about it since the same date.  It is not
> always spelled out because it is a pretty simple and
> direct consequence of the definition.


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

Reply via email to