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

Small fixes for ExactReal #638

Merged
merged 2 commits into from Apr 22, 2024
Merged

Conversation

Kolaru
Copy link
Collaborator

@Kolaru Kolaru commented Apr 22, 2024

This contains two small fixes that are useful for the update of IntervalRootFinding.

  1. Allow to use ExactReal{<:Integer} to index an array.
  2. Fix derivative of ^ when mixing ExactReal and Interval in the ForwardDiff extension.

The first one in particular may be handy for everyone, when working with vectors of interval for example. With this PR, indexing work as intuitively expected with @exact

julia> @exact f(x) = x[1] + x[2] + 1.2
f (generic function with 1 method)

julia> X = [interval(-1, 1), interval(-0.1, 3)]
2-element Vector{Interval{Float64}}:
 [-1.0, 1.0]_com
 [-0.100001, 3.0]_com

julia> f(X)
[0.0999999, 5.20001]_com

@OlivierHnt
Copy link
Member

Nice ! LGTM

@Kolaru Kolaru merged commit 7ec07bc into JuliaIntervals:master Apr 22, 2024
16 checks passed
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.

None yet

2 participants