Closed
Description
julia> interval(typemin(Int64), typemax(Int64))
┌ Warning: ill-formed interval [a, b] with a = -9223372036854775808, b = 9223372036854775807 and decoration d = com. NaI is returned
└ @ IntervalArithmetic ~/.julia/packages/IntervalArithmetic/7EbAT/src/intervals/construction.jl:413
∅_ill
despite that should be a valid interval. I think this happens because of the definition
is_valid_interval(::Flavor{:set_based}, a::Real, b::Real) = b - a ≥ 0
and b - a
overflows in this case
julia> typemax(Int64) - typemin(Int64)
-1
I guess the motivation for not writing the check as b >= a
was disallowing interval(Inf, Inf)
, or was there another compelling reason?
Metadata
Metadata
Assignees
Labels
No labels