Boost logo

Boost :

From: Martin Bonner (martin.bonner_at_[hidden])
Date: 2005-06-21 07:59:53


----Original Message----
From: Alisdair Meredith [mailto:alisdair.meredith_at_[hidden]]
Sent: 21 June 2005 12:59
To: boost_at_[hidden]
Subject: Re: [boost] [test] investigating Borland test_fp_comparisons
failure

> Gennadiy Rozental wrote:
>
>> All of the above should pass, since the algotrithm used:
>>
>> x and y are close iff:
>>
>>> x-y| / |x| < tol/100 and |x-y| / |y| < tol/100
>>
>> Obviosly nothing could be close to zero and rest are failing also.
>
> In that case I find the algorithm to be confusingly named, as in all
> these cases the test value is 'closer' to zero than the delta. I
> would
> not expect closeness to zero (or any other arbitrary number) to affect
> a general proximity test.

The tolerance is a percentage tolerance, rather than an absolute value.

A percentage tolerance makes sense if you regard 1E-10 as far from 1 as 1 is
from 1E10. If you do, then 0 is infinitely far from any other finite
number. If you don't, then I suggest you are using floating point as an
easy substitute for fixed-point arithmetic (which is what I do).

-- 
Martin Bonner
Martin.Bonner_at_[hidden]
Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ,
ENGLAND Tel: +44 (0)1223 441434

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk