Re: Fixing geometic calculation

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fixing geometic calculation
Date: 2009-08-07 17:51:36
Message-ID: 20090807175136.GN5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 07, 2009 at 12:50:39PM -0400, Tom Lane wrote:
> Sam Mason <sam(at)samason(dot)me(dot)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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-08-07 17:51:53 Re: "PANIC: cannot make new WAL entries during recovery" in the wild
Previous Message Tom Lane 2009-08-07 17:33:59 Re: \copy: unexpected response (4)