Skip to content

library calculates the center incorrectly #35

@berthubert

Description

@berthubert

On line 107 more or less, the center is currently calculated by adding start and stop and dividing the result by 2. This is prone to overflow, it is better to calculate the center like this:

center = minmaxStart.first->start + (minmaxStart.first->stop - minmaxStop.second->start) / 2;

This will never overflow.

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