From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: In geo_ops.c, represent infinite slope as Infinity, not DBL_MAX.
Date: Sat, 21 Nov 2020 22:30:53 +0000
Message-ID: <E1kgbPB-0006UY-NO@gemulon.postgresql.org> (raw)
In geo_ops.c, represent infinite slope as Infinity, not DBL_MAX.
Since we're assuming IEEE floats these days, there seems little
reason not to do this. It has the advantage that when the slope is
computed as infinite due to the presence of Inf coordinates, we get
saner behavior than before from line_construct(), and thence also
in some dependent operations such as finding the closest point.
Also fix line_construct() to special-case slope zero. The previous
coding got the right answer in most cases, but it could compute
C as NaN when the point has Inf coordinates.
Discussion: https://postgr.es/m/CAGf+fX70rWFOk5cd00uMfa__0yP+vtQg5ck7c2Onb-Yczp0URA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9fe649ea295f00baf6d0f0c1f9b0cb1298f64fb9
Modified Files
--------------
src/backend/utils/adt/geo_ops.c | 19 ++-
src/test/regress/expected/geometry.out | 254 ++++++++++++++++-----------------
2 files changed, 140 insertions(+), 133 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: In geo_ops.c, represent infinite slope as Infinity, not DBL_MAX.
In-Reply-To: <E1kgbPB-0006UY-NO@gemulon.postgresql.org>
References: <E1kgbPB-0006UY-NO@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox