Skip to content
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

Extend conversion #686

Merged
merged 4 commits into from
Oct 19, 2024
Merged

Extend conversion #686

merged 4 commits into from
Oct 19, 2024

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
16 checks passed
@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