How IntervalSets and UnitRanges compare in functionality?

They don’t represent the same things.

julia> 2.5 in ClosedInterval{Float64}(1,3)
true

julia> 2.5 in 1:3
false

Intervals are not enumerable (… naturally)

5 Likes