Skip to content

Logic error in bounding rectangle initialization. #27

@MK-3PP

Description

@MK-3PP

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions