You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
suspect behavior when attempting to bisect an unbounded interval #781
When i is an interval unbounded from at least one side, when α is a real number between zero and one, bisect(i, α) should not depend on α, except perhaps if α=0 or α=1 (not sure how should bisect behave for α=0 or α=1).
I'm not sure either, but a lot is wrong here, seemingly from two different sources:
mid for half-infinite intervals is wrong when alpha is not 0.5. Note that the behavior is specified in the standard only for alpha = 0.5
High bounds prevfloat(Inf) is displayed as infinite but it shouldn't
julia> X =bareinterval(7.0, Inf)
[7.0, ∞)
julia> m =mid(X, 0.4)
7.0# This is wrong, should be prevfloat(Inf)
julia> m2 =mid(X, 0.5)
1.7976931348623157e308# Correct
julia> X2 = IntervalArithmetic._unsafe_bareinterval(Float64, 7.0, m2)
[7.0, ∞) # looks wrong, should be [7.0, 1.7976931348623157e308], but it is only a display thing
julia> X2.hi
1.7976931348623157e308# The bound is correct
Activity
nsajko commentedon Sep 23, 2026
Versions:
OlivierHnt commentedon Sep 23, 2026
Not sure when this behavior was first introduced. Note that this is the same for
mid(x, alpha).@dpsanders @Kolaru @lbenet
Kolaru commentedon Oct 5, 2026
I'm not sure either, but a lot is wrong here, seemingly from two different sources:
midfor half-infinite intervals is wrong whenalphais not0.5. Note that the behavior is specified in the standard only foralpha = 0.5prevfloat(Inf)is displayed as infinite but it shouldn'tnsajko commentedon Oct 5, 2026
the display issue above is issue #780
Kolaru commentedon Oct 8, 2026
As discussed in today JuliaInterval call, the behavior should be for an half infinite interval
X = [a, Inf):mid(X, alpha) == prevfloat(Inf)if0 < alpha < 1alpha == 0oralpha == 1And similarly for
-Infbound.