Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit43fe90f

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, sincethe underlying computation should be exactly 0 - 0. Perhaps there's somewider-than-nominal-precision calculations happening? Anyway, the best wayto avoid platform-dependent results seems to be to explicitly reset -0 toregular zero.
1 parent1f7a479 commit43fe90f

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
#ifdefGEODEBUG
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)

[8]ページ先頭

©2009-2025 Movatter.jp