From b17470d44d875fe23ba682ebe7d63602911eb2c5 Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Sat, 27 Jul 2024 20:49:22 +1200 Subject: [PATCH] Fix MaximumInscribedCircle::computeMaximumIterations for small values (#1133) --- src/algorithm/construct/MaximumInscribedCircle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithm/construct/MaximumInscribedCircle.cpp b/src/algorithm/construct/MaximumInscribedCircle.cpp index b20d14a084..c3a4710784 100644 --- a/src/algorithm/construct/MaximumInscribedCircle.cpp +++ b/src/algorithm/construct/MaximumInscribedCircle.cpp @@ -85,9 +85,9 @@ MaximumInscribedCircle::computeMaximumIterations(const Geometry* geom, double to double diam = geom->getEnvelopeInternal()->getDiameter(); double ncells = diam / toleranceDist; //-- Using log of ncells allows control over number of iterations - std::size_t factor = (std::size_t) std::log(ncells); + int factor = (int) std::log(ncells); if (factor < 1) factor = 1; - return 2000 + 2000 * factor; + return (std::size_t) (2000 + 2000 * factor); } /* public */