Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic error in bounding rectangle initialization. #27

Open
MK-3PP opened this issue Feb 5, 2020 · 1 comment
Open

Logic error in bounding rectangle initialization. #27

MK-3PP opened this issue Feb 5, 2020 · 1 comment

Comments

@MK-3PP
Copy link

MK-3PP commented Feb 5, 2020

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();

@abellgithub
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants