Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Construction of interval when mixing real and complex arguments #611

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/intervals/construction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions test/interval_tests/complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down