Skip to content

Commit

Permalink
Use better bump for safe floor evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-jts committed Sep 10, 2023
1 parent da6215c commit 30dc8a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion capi/geos_ts_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2983,7 +2983,7 @@ extern "C" {
//-- check for an integral scale
double scale = 1.0 / gridSize;
//-- add a small "bump" to ensure flooring works
double scaleInt = std::floor(scale + 0.1);
double scaleInt = std::floor(scale + 2 * GRIDSIZE_INTEGER_TOLERANCE);
//-- if scale factor is essentially integral, use the exact integer value
if (std::abs(scale - scaleInt) < GRIDSIZE_INTEGER_TOLERANCE) {
scale = scaleInt;
Expand Down

0 comments on commit 30dc8a1

Please sign in to comment.