invenia / Intervals.jl

Non-iterable ranges
MIT License
36 stars 18 forks source link

0.0 <= Interval{Float64, Closed, Closed}(0.0, 1.0) returns false #221

Open leoluecken opened 1 year ago

leoluecken commented 1 year ago

That's unexpected, isn't it?

With Julia 1.9.2 and Intervals v1.10.0

leoluecken commented 1 year ago

@omus Looking into this, the problem seems that there is no specific definition of <= for Intervals, which means the operation defaults to (x < y) | (x == y).

To fix this, one would probably implement corresponding operations along the lines of isless_xxx() in Interval.jl, lines 288 ff (at below ##### EQUALITY #####) - Just copy all that stuff to analogous functions islesseq_xxx(), right?

Refs. #14 <- I didn't dive into that, but might be relevant.