Skip to content

Interval.Union produces wrong bounds when one interval is unbounded #9

@andrew

Description

@andrew

In Interval.Union, when one interval has an unbounded min (empty string) and the other has a concrete min, the code takes the concrete value instead of keeping it unbounded:

} else if i.Min == "" {
    result.Min = other.Min // should stay "" (unbounded)

Same for max in the reverse direction. The union of (-inf, 2.0] and [1.0, +inf) should be (-inf, +inf), but currently produces [1.0, 2.0].

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