delaunator-cpp icon indicating copy to clipboard operation
delaunator-cpp copied to clipboard

Logic error in bounding rectangle initialization.

Open MK-3PP opened this issue 5 years ago • 1 comments

std::numeric_limits::min() is used to initialize maximum value variables that should grow to the highest encountered value. It represents the smallest positive normal double, so this value can never grow negative (e. g. for only negative inputs). Use std::numeric_limits::lowest() istead.

Lines 223 and 224 of delaunator.hpp: double max_x = std::numeric_limits::min(); double max_y = std::numeric_limits::min();

should be: double max_x = std::numeric_limits::lowest(); double max_y = std::numeric_limits::lowest();

MK-3PP avatar Feb 05 '20 11:02 MK-3PP

Fixed in https://github.com/abellgithub/delaunator-cpp

abellgithub avatar Feb 10 '20 14:02 abellgithub