Skip to content

Commit

Permalink
Remove iszero(ExactReal)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolaru committed May 27, 2024
1 parent ed52dd9 commit 271d476
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion ext/IntervalArithmeticForwardDiffExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ end
function Base.:(^)(x::Dual{<:Tx}, y::ExactReal) where Tx
v = value(x)
expv = v^y
if iszero(y) || all(iszero.(values(partials(x))))
if iszero(y.value) || all(iszero.(values(partials(x))))
new_partials = zero(partials(x))
else
new_partials = partials(x) * y * v^(y - 1)
Expand Down
2 changes: 0 additions & 2 deletions src/intervals/exact_literals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ struct ExactReal{T<:Real} <: Real
ExactReal(value::T) where {T<:Real} = new{T}(value)
end

Base.iszero(x::ExactReal) = iszero(x.value)

_value(x::ExactReal) = x.value # hook for interval constructor

# allow to index with ExactReal
Expand Down

0 comments on commit 271d476

Please sign in to comment.