Skip to content

Commit 5efff56

Browse files
Fix #123425 numerical floating point edge case (#127982) (#128014) (#128017)
1 parent 52680e3 commit 5efff56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/geo/src/test/java/org/elasticsearch/geometry/utils/SpatialEnvelopeVisitorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public void testVisitGeoPointsWrapping() {
134134
} else {
135135
// Both positive and negative x values exist, we need to decide which way to wrap the bbox
136136
double unwrappedWidth = maxPosX - minNegX;
137-
double wrappedWidth = (180 - minPosX) - (-180 - maxNegX);
137+
double wrappedWidth = 360.0 + maxNegX - minPosX;
138138
if (unwrappedWidth <= wrappedWidth) {
139139
// The smaller bbox is around the front of the planet, no dateline wrapping required
140140
assertRectangleResult(i + ": " + point, result, minNegX, maxPosX, maxY, minY, false);

0 commit comments

Comments
 (0)