diff --git a/DDSegmentation/src/Segmentation.cpp b/DDSegmentation/src/Segmentation.cpp index c38abe05af0d498ec364eb580d4abe6423371686..d30dc47ee4db3467f8350f76f9257fb25a17803b 100644 --- a/DDSegmentation/src/Segmentation.cpp +++ b/DDSegmentation/src/Segmentation.cpp @@ -141,7 +141,7 @@ double Segmentation::binToPosition(long64 bin, double cellSize, double offset) { /// Helper method to convert a 1D position to a cell ID int Segmentation::positionToBin(double position, double cellSize, double offset) { - if (cellSize == 0.) { + if (cellSize <= 1e-10) { throw runtime_error("Invalid cell size: 0.0"); } return int(floor((position + 0.5 * cellSize - offset) / cellSize));