Skip to content

Commit

Permalink
Fix cancelminus stack overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolaru committed Aug 15, 2019
1 parent 1e3c2a0 commit b4fbd97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/intervals/arithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ Return the unique interval `c` such that `b+c=a`.
See Section 12.12.5 of the IEEE-1788 Standard for
Interval Arithmetic.
"""
function cancelminus(a::Interval{T}, b::Interval{T}) where T
function cancelminus(a::Interval{T}, b::Interval{T}) where {T}
(isempty(a) && (isempty(b) || !isunbounded(b))) && return emptyinterval(T)

(isunbounded(a) || isunbounded(b) || isempty(b)) && return entireinterval(T)
Expand All @@ -546,7 +546,7 @@ function cancelminus(a::Interval{T}, b::Interval{T}) where T

return entireinterval(T)
end
cancelminus(a::Interval, b::Interval) = cancelminus(promote(a, b)...)
cancelminus(a::Interval{T}, b::Interval{S}) where {T, S} = cancelminus(promote(a, b)...)

"""
cancelplus(a, b)
Expand Down

0 comments on commit b4fbd97

Please sign in to comment.