-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interval creation with .. returns inconsistent types #416
Comments
You're right that that seems wrong according to Julia's standard promotion mechanism: julia> promote(1, 3.5f0)
(1.0f0, 3.5f0) |
That is due to using
|
But yes this should be fixed. |
I don't find what should be the differences between |
|
Just to clarify with an example what @Kolaru wrote above, Regarding julia> using IntervalArithmetic
julia> setformat(:full);
julia> a = Interval(0.1,0.25)
Interval(0.1, 0.25)
julia> b = 0.1 .. 0.25
Interval(0.09999999999999999, 0.25)
julia> 1//10 ∈ a
false
julia> 1//10 ∈ b
true So the "cleverness" to which @Kolaru referred is related to "correct" (outer) rounding. |
This is explained in the docs: https://juliaintervals.github.io/IntervalArithmetic.jl/stable/construction/ |
I'll put a RTFM on the side of my screen. Sorry. |
I find it strange that:
I would think that
typeof(Int(0)..Float32(0.5)) == Interval{Float32}
The text was updated successfully, but these errors were encountered: