emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Elisp manual, node "Comparison of Numbers"


From: David Kastrup
Subject: Re: Elisp manual, node "Comparison of Numbers"
Date: Mon, 29 May 2006 16:23:51 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Lennart Borgman <address@hidden> writes:

> David Kastrup wrote:
>>>>>>                 
>>>>> The problem here is that fuzz is a _relative_ measure of equality, and
>>>>> you employ it as an absolute measure here.  I don't think it a good
>>>>> idea at all that 1e-12 and 0.995e-12 are considered different, while
>>>>> 1e-8 and 0.0 are considered equal.
>>>>>             
>>>> Agree!
>>>>         
>>> Hm. It is the relative distance from 0.
>>>     
>>
>> It is merely the distance from 0, not the "relative distance".
>>   
> Yes, in a sense you are right. I should have expressed my self a bit
> differently, but I am afraid you missed the point. The crucial thing
> is that you divide the difference with the "distance" from 0 to
> construct the number you compare to the fuzz factor.

In which case, the relative distance from 0 is 1.0 for _any_ nonzero
number.  And your point was?

> It seems reasonable to me but breaks down in the special case where
> one of the numbers are 0 (and the other is not).

Relative measures don't work when comparing with 0.  But 0.0 can
pretty much only come about by cancellation, and then comparison is
unreliable anyway.  It might be worth pointing out, but it certainly
is not a remedy to rechristen a relative measure to absolute.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]