Skip to content

Commit 43fe90f

Browse files
committed
Suppress -0 in the C field of lines computed by line_construct_pts().
It's not entirely clear why some PPC machines are generating -0 here, since the underlying computation should be exactly 0 - 0. Perhaps there's some wider-than-nominal-precision calculations happening? Anyway, the best way to avoid platform-dependent results seems to be to explicitly reset -0 to regular zero.
1 parent 1f7a479 commit 43fe90f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/utils/adt/geo_ops.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,9 @@ line_construct_pts(LINE *line, Point *pt1, Point *pt2)
11161116
line->A = (pt2->y - pt1->y) / (pt2->x - pt1->x);
11171117
line->B = -1.0;
11181118
line->C = pt1->y - line->A * pt1->x;
1119+
/* on some platforms, the preceding expression tends to produce -0 */
1120+
if (line->C == 0.0)
1121+
line->C = 0.0;
11191122
#ifdef GEODEBUG
11201123
printf("line_construct_pts- line is neither vertical nor horizontal (diffs x=%.*g, y=%.*g\n",
11211124
DBL_DIG, (pt2->x - pt1->x), DBL_DIG, (pt2->y - pt1->y));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy