Skip to content

Commit

Permalink
Fix method ambiguities
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHnt committed Apr 8, 2024
1 parent 8806b9c commit a38d47c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/intervals/arithmetic/power.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ Base.:^(x::Complex{<:Interval}, y::Complex{<:Interval}) = ^(promote(x, y)...)
Base.:^(x::Complex{<:Interval}, y::Real) = ^(promote(x, y)...)
Base.:^(x::Real, y::Complex{<:Interval}) = ^(promote(x, y)...)
# needed to avoid method ambiguities
Base.:^(x::Complex{<:Interval}, n::Bool) = ^(promote(x, n)...)
Base.:^(x::Complex{<:Interval}, n::Integer) = ^(promote(x, n)...)
Base.:^(x::Complex{<:Interval}, n::Rational) = ^(promote(x, n)...)

# overwrite behaviour for small integer powers from https://github.com/JuliaLang/julia/pull/24240
# Base.literal_pow(::typeof(^), x::Interval, ::Val{n}) where {n} = x^n
Expand Down

0 comments on commit a38d47c

Please sign in to comment.