Skip to content

Comments

Extend conversion#686

Merged
OlivierHnt merged 4 commits intoJuliaIntervals:masterfrom
OlivierHnt:conversion
Oct 19, 2024
Merged

Extend conversion#686
OlivierHnt merged 4 commits intoJuliaIntervals:masterfrom
OlivierHnt:conversion

Conversation

@OlivierHnt
Copy link
Member

This PR re-introduce Interval(::Real) and Interval{T}(::Real), marking the output with the "NG flag".

It also adds a conversion in the ForwardDiff extension between ExactReal and Dual.

Closes #685

@OlivierHnt
Copy link
Member Author

Previously broken tests now pass.

@lbenet
Copy link
Member

lbenet commented Oct 10, 2024

This PR re-introduce Interval(::Real) and Interval{T}(::Real), marking the output with the "NG flag".

Do we really want/need this? We have discussed that, indeed without it becomes uncomfortable, but also imposes being carefull wrt silent errors.

Adding the conversion in the ForwardDiff extension is really appreciated!

@OlivierHnt
Copy link
Member Author

OlivierHnt commented Oct 10, 2024

Yes we should be cautious.
I could be missing something, but at the time we removed Interval(x::Real) and Interval{T}(x::Real), we did not have the "NG flag" mechanism right? Since we currently allow convert(Interval{Float64}, 1) maybe it makes sense to have Interval{Float64}(1.0)? As a bonus, this would help with #668.

@OlivierHnt
Copy link
Member Author

So what should we do with this PR? Is reintroducing Interval(x) and Interval{Float64}(x) in the 0.22 release reasonable if we use the "NG flag" (so same behaviour as convert(Interval{Float64}, x))?

@OlivierHnt
Copy link
Member Author

I will go ahead and merge this PR. If one has strong feelings against it, we can revert it before the next release.

@OlivierHnt OlivierHnt merged commit d9735c9 into JuliaIntervals:master Oct 19, 2024
@OlivierHnt OlivierHnt deleted the conversion branch October 19, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conversion issue when combining StaticArrays, ForwardDif, and IntervalArithmetic

2 participants