Skip to content

Commit 911499d

Browse files
committed
Rename getnumtype to promote_numtype
1 parent a1a9fd2 commit 911499d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/decorations/intervals.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ end
3434
DecoratedInterval(I::DecoratedInterval, dec::DECORATION) = DecoratedInterval(I.interval, dec)
3535

3636
function DecoratedInterval(a::T, b::S, d::DECORATION) where {T<:Real, S<:Real}
37-
BoundsType = getnumtype(T, S)
37+
BoundsType = promote_numtype(T, S)
3838
is_valid_interval(a, b) || return DecoratedInterval(Interval{BoundsType}(a, b), ill)
3939
return DecoratedInterval(Interval{BoundsType}(a, b), d)
4040
end
@@ -52,7 +52,7 @@ end
5252
DecoratedInterval(I::Interval) = DecoratedInterval{default_bound()}(I)
5353

5454
function DecoratedInterval(a::T, b::S) where {T<:Real, S<:Real}
55-
BoundsType = getnumtype(T, S)
55+
BoundsType = promote_numtype(T, S)
5656
is_valid_interval(a, b) || return DecoratedInterval(Interval{BoundsType}(a, b), ill)
5757
return DecoratedInterval(Interval{BoundsType}(a, b))
5858
end

src/intervals/construction.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ Interval{Float64}
3535
default_bound() = Float64
3636

3737
# Produce the type of the bounds of an interval when not explicitly imposed
38-
getnumtype(::Type{T}, ::Type{S}) where {T<:AbstractFloat, S<:AbstractFloat} = promote_type(T, S)
39-
getnumtype(::Type{T}, ::Type{S}) where {T<:AbstractFloat, S} = promote_type(T, S)
40-
getnumtype(::Type{T}, ::Type{S}) where {T, S<:AbstractFloat} = promote_type(T, S)
41-
getnumtype(::Type{T}, ::Type{S}) where {T, S} = promote_type(default_bound(), T, S)
38+
promote_numtype(::Type{T}, ::Type{S}) where {T<:AbstractFloat, S<:AbstractFloat} = promote_type(T, S)
39+
promote_numtype(::Type{T}, ::Type{S}) where {T<:AbstractFloat, S} = promote_type(T, S)
40+
promote_numtype(::Type{T}, ::Type{S}) where {T, S<:AbstractFloat} = promote_type(T, S)
41+
promote_numtype(::Type{T}, ::Type{S}) where {T, S} = promote_type(default_bound(), T, S)
4242

4343
@inline _normalisezero(a::Real) = ifelse(iszero(a), zero(a), a)
4444

@@ -94,7 +94,7 @@ function interval(::Type{T}, a, b) where {T}
9494
@warn "Invalid input, empty interval is returned"
9595
return emptyinterval(T)
9696
end
97-
interval(a::T, b::S) where {T, S} = interval(getnumtype(T, S), a, b)
97+
interval(a::T, b::S) where {T, S} = interval(promote_numtype(T, S), a, b)
9898

9999
# Real: `is_valid_interval(a, a) != true`
100100
interval(::Type{T}, a::Real) where {T} = interval(T, a, a)

0 commit comments

Comments
 (0)