Skip to content

Commit

Permalink
Add Dual(x::ExactReal)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbenet committed Oct 14, 2024
1 parent a56fa01 commit 2c466d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ext/IntervalArithmeticForwardDiffExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using ForwardDiff: Dual, ≺, value, partials

# Needed to avoid method ambiguities:
ForwardDiff.can_dual(::Type{ExactReal}) = true
Dual(x::ExactReal) = Dual{Nothing, typeof(x), 0}(x.value)
Base.convert(::Type{Dual{T, V, N}}, x::ExactReal) where {T, V, N} = promote_rule(Dual{T, V, N}, typeof(x))(x.value)

Base.promote_rule(::Type{Dual{T, V, N}}, ::Type{Interval{S}}) where {T, V, N, S<:Union{AbstractFloat, Rational}} =
Expand Down

0 comments on commit 2c466d2

Please sign in to comment.