Re: Fixing geometic calculation - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fixing geometic calculation
Date
Msg-id 22842.1249659658@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fixing geometic calculation  (Sam Mason <sam@samason.me.uk>)
Responses Re: Fixing geometic calculation  (Sam Mason <sam@samason.me.uk>)
List pgsql-hackers
Sam Mason <sam@samason.me.uk> writes:
> I would agree with Paul that EPSILON is a hack and probably should be
> removed.

It's a hack but it's dealing with an extremely real problem, namely
the built-in inaccuracy of floating-point arithmetic.  You can't just
close your eyes to that and hope that everything will be okay.

A quick look through the geometry sources says that we might not be
critically dependent on anything except the assumption that two values
that aren't FPeq() will have a nonzero difference.  (If you think this
is a tautology, you don't know enough about floating point arithmetic
to be qualified to offer an opinion here...)  We might be able to base
a tighter comparison procedure on that rule.  It would take a lot more
investigation to be sure though.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Review: Revise parallel pg_restore's scheduling heuristic
Next
From: Jaime Casanova
Date:
Subject: Re: Filtering dictionaries support and unaccent dictionary