Skip to content

Commit e6169a3

Browse files
committed
Fix convert(Complex{<:Interval}, AbstractIrrational)
1 parent 04100ab commit e6169a3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/intervals/construction.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,13 @@ function Base.convert(::Type{Interval{T}}, x::Complex{<:Interval}) where {T<:Num
568568
end
569569

570570
Base.convert(::Type{Complex{Interval{T}}}, x::Interval) where {T<:NumTypes} =
571-
interval(T, complex(x))
571+
complex(interval(T, x))
572572

573+
# always guaranteed since an `AbstractIrrational` is a defined fixed constant
573574
Base.convert(::Type{Interval{T}}, x::AbstractIrrational) where {T<:NumTypes} =
574-
interval(T, x) # always guaranteed since an `AbstractIrrational` is a defined fixed constant
575+
interval(T, x)
576+
Base.convert(::Type{Complex{Interval{T}}}, x::AbstractIrrational) where {T<:NumTypes} =
577+
complex(interval(T, x))
575578

576579
function Base.convert(::Type{Interval{T}}, x::Real) where {T<:NumTypes}
577580
y = interval(T, x)

0 commit comments

Comments
 (0)