diff --git a/src/intervals/construction.jl b/src/intervals/construction.jl index deaf85299..ec3675099 100644 --- a/src/intervals/construction.jl +++ b/src/intervals/construction.jl @@ -481,9 +481,9 @@ end _interval_infsup(::Type{T}, a::Complex, b::Complex, d::Decoration = com) where {T<:NumTypes} = complex(_interval_infsup(T, real(a), real(b), d), _interval_infsup(T, imag(a), imag(b), d)) _interval_infsup(::Type{T}, a::Complex, b, d::Decoration = com) where {T<:NumTypes} = - complex(_interval_infsup(T, real(a), b, d), _interval_infsup(T, imag(a), imag(a), d)) + complex(_interval_infsup(T, real(a), real(b), d), _interval_infsup(T, imag(a), imag(b), d)) _interval_infsup(::Type{T}, a, b::Complex, d::Decoration = com) where {T<:NumTypes} = - complex(_interval_infsup(T, a, real(b), d), _interval_infsup(T, imag(b), imag(b), d)) + complex(_interval_infsup(T, real(a), real(b), d), _interval_infsup(T, imag(a), imag(b), d)) # midpoint constructors diff --git a/test/interval_tests/complex.jl b/test/interval_tests/complex.jl index 87ddc206f..7f2a141a1 100644 --- a/test/interval_tests/complex.jl +++ b/test/interval_tests/complex.jl @@ -20,6 +20,9 @@ @test isequal_interval(intersect_interval(c, hull(a, b)), complex(interval(0, 3), interval(1, 2))) @test isempty_interval(intersect_interval(a, b)) @test isdisjoint_interval(a, b) + + @test isequal_interval(interval(-1 - im, 0), interval(-1 - im, 0 + 0im)) + @test isequal_interval(interval(0, 1 + im), interval(0 + 0im, 1 + im)) end @testset "Inverse roots of unity" begin