Re: Fixing geometic calculation - Mailing list pgsql-hackers

From Sam Mason
Subject Re: Fixing geometic calculation
Date
Msg-id 20090807175136.GN5407@samason.me.uk
Whole thread Raw
In response to Re: Fixing geometic calculation  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Fixing geometic calculation  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Aug 07, 2009 at 12:50:39PM -0400, Tom Lane wrote:
> Sam Mason <sam@samason.me.uk> writes:
> > Sorry, I'm struggling to parse that.  I think it's all the double
> > negatives.  Are you saying that HYPOT() should really return zero when
> > it's currently giving back would be FPzero?
> 
> No, I'm worried about code that supposes that it can divide by (x - y)
> after testing that FPeq(x,y) is not true.  point_sl() for instance.

OK, but I'm still not sure what you're getting at.  If it's infinities
and NaNs then they shouldn't matter and will be taken care of by the
normal FP rules anyway.

> We could perhaps fix those specific issues by testing the difference
> explicitly instead of doing it like that.  But there's still the overall
> problem of error accumulation ...

Errors will accumulate whatever happens, that's why things like interval
arithmetic exist that usefully track those errors and why I said testing
EPSILON isn't a useful.

--  Sam  http://samason.me.uk/


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] \copy: unexpected response (4)
Next
From: Tom Lane
Date:
Subject: Re: "PANIC: cannot make new WAL entries during recovery" in the wild