Skip to content

Histogram bin centres overflow for pixels near the float64 limit #75

Closed

Description

@guijacquemet

Found while fixing #32 (PR #74): _linear_percentile no longer overflows when interpolating between huge finite endpoints, but histogram.py's bin-centre computation still overflows for such pixel values, so the end-to-end path cannot yet reach the fixed interpolation (the #74 regression test calls _linear_percentile directly).

Fix: compute bin centres without forming an overflowing sum (e.g. lo/2 + hi/2 or lo + (hi - lo)/2 guarded like _lerp), or refuse with a named error when a centre is not representable; outputs for valid inputs must stay bitwise identical (tools/dump_outputs.py). Add an end-to-end test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions