zero-handling.patch
text/x-patch
Filename: zero-handling.patch
Type: text/x-patch
Part: 0
Message:
Re: [PATCH] Improve geometric types
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/backend/utils/adt/geo_ops.c | 3 | 0 |
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index 1fb2ff2603..fefb03ee86 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 (line->C == 0.0) + line->C = 0.0; } }