Skip to content

Commit

Permalink
Fix constructor Complex{<:Interval} for ExactReal
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHnt committed Jun 21, 2024
1 parent 5b3d244 commit 00fe0ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/intervals/exact_literals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ Base.promote_rule(::Type{ExactReal{T}}, ::Type{BigFloat}) where {T<:Real} =
Base.promote_rule(::Type{BigFloat}, ::Type{ExactReal{T}}) where {T<:Real} =
promote_type(BigFloat, T)

# to complex -- by-pass default from Base which lead to "NG" flag in the (zero) imaginary part

Base.Complex{T}(x::ExactReal) where {T<:Interval} = Complex{T}(x, zero(x))

# display

Base.show(io::IO, x::ExactReal{T}) where {T<:AbstractFloat} =
Expand Down

0 comments on commit 00fe0ac

Please sign in to comment.