Boost logo

Boost :

Subject: Re: [boost] Updating the Boost Review Process Was: [GGL] Bost.Polygon (GTL) vs GGL - rationale
From: Barend Gehrels (barend_at_[hidden])
Date: 2009-11-19 13:24:04


Hi Fernando,

Fernando Cacciola wrote:
> Hi Barend,
>
>> I know that 1e-10 is too large, for FP comparisons.
>
> Really?
>
> Let's see:
>
> Given these 2D straight line segments segments:
>
> s0: (-e,0) - (e ,h)
> s1: (0 ,0) - (0 ,h)
> s2: (e ,0) - (-e,h)
>
> where 'e' is a really small number, say 1e-5, and h a really big
> number, say 1e5
>
> Now compute the intersection points p between s0 and s1, and q between
> s1 and s2.
>
> You can see from basic reasoning that p and q should he exactly
> coincident, but what are the computed coordinates of p and q using
> 'double' (you can even try it with a straight C expression, FWIW,
> since the goal is to understand FP behaviour)?
> What is their distance? (i.e. the error)
>
> That example is off the top of my head, so the points might be closer
> than I imagine, but let's see what the results are.
>
That epsilon on which the discussion started is only used to set a
boolean flag "trivial", which might be set anyway.

But I will try it and report it, it is interesting, thanks.

Regards, Barend


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