aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2018-07-29 20:35:18 +0200
committerTomas Vondra <tomas.vondra@postgresql.org>2018-07-29 21:11:05 +0200
commit74294c7301340eeb477343dd26d98d2f3e33bd20 (patch)
treebaf3c30c0a9ebcdef1d04dd0f39a10a5dfbce847
parentfb17eabf1b513614946bfc37125c83db197d2c68 (diff)
downloadpostgresql-74294c7301340eeb477343dd26d98d2f3e33bd20.tar.gz
postgresql-74294c7301340eeb477343dd26d98d2f3e33bd20.zip
Restore handling of -0 in the C field of lines in line_construct().
Commit a7dc63d904 inadvertedly removed this bit originally introduced by 43fe90f66a, causing regression test failures on some platforms, due to producing {1,-1,-0} instead of {1,-1,0}.
-rw-r--r--src/backend/utils/adt/geo_ops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index 1fb2ff2603c..621b5c33ef1 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -1024,6 +1024,9 @@ line_construct(LINE *result, Point *pt, float8 m)
result->A = m;
result->B = -1.0;
result->C = pt->y - m * pt->x;
+ /* on some platforms, the preceding expression tends to produce -0 */
+ if (result->C == 0.0)
+ result->C = 0.0;
}
}