[postgis-tickets] [PostGIS] #4990: getfacecontainingpoint fails on i386
PostGIS
trac at osgeo.org
Sun Sep 26 12:32:44 PDT 2021
#4990: getfacecontainingpoint fails on i386
-----------------------------+---------------------------
Reporter: Bas Couwenberg | Owner: strk
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 3.2.0
Component: topology | Version: master
Resolution: | Keywords:
-----------------------------+---------------------------
Comment (by strk):
I've handled to get debugging output of a failing run by moving the DEBUG
to *after* the less-than comparison. This means that the less-then
comparison works differently IF the {{{ dist_sqr }}} is printed in a debug
or not. This very much points to some compiler optimization, using more
bits in some cases for computations. Anyway, the debug shows this:
{{{
DEBUG: [lwgeom_topo.c:lwt_GetFaceContainingPoint:7092] Closest edge 26:
LINESTRING(4 31,7 31,7 34,4 34,4 31)
DEBUG: [lwgeom_topo.c:lwt_GetFaceContainingPoint:7098] Shortest line to
closest edge 26: LINESTRING(7 31,7.1 31)
DEBUG: [lwgeom_topo.c:lwt_GetFaceContainingPoint:7104] Closest point on
closest edge: POINT(7 31)
DEBUG: [lwgeom_topo.c:lwt_GetFaceContainingPoint:7210] Closest point is
NOT a node
DEBUG: [ptarray.c:ptarray_closest_segment_2d:1316] Sqr distance from seg
0: 0.009999999999999929084504302
DEBUG: [ptarray.c:ptarray_closest_segment_2d:1316] Sqr distance from seg
1: 0.009999999999999929084504302
DEBUG: [lwgeom_topo.c:lwt_GetFaceContainingPoint:7237] Closest segment on
edge 26 is 1
}}}
That's a 25 significant digit figure, printed as all EQUAL digit, and
still finding the second number being < than the first one ! Maybe this is
a place to use DBL_EPSILON macro, although I don't feel like we should be
doing such things :(
Paul: is DBL_EPSILON macro yours ?
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4990#comment:26>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list