Skip to content

Docs: how to handle branching? #524

Closed
@petvana

Description

@petvana

This is more like a question. I haven't found any information in the docs about handling branching while using InrervalArithmetic. For example

julia> using IntervalArithmetic

julia> f(x) = x > 1 ? x-1 : x
f (generic function with 1 method)

julia> f(0.9..1.1)
[0.899999, 1.10001] # expecting [0.0, 1.0]

julia> f.([0.9, 1.1])
2-element Vector{Float64}:
 0.9
 0.10000000000000009

The code produces an incorrect interval because 0.9..1.1 > 1 == false is valid only for part of the interval. Is there any way to handle such situations?

Btw, what about producing a warning?

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