Skip to content

Commit

Permalink
Fix inf and sup of empty set
Browse files Browse the repository at this point in the history
  • Loading branch information
dpsanders committed Sep 27, 2018
1 parent 8132d1c commit 4116481
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/intervals/arithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,17 @@ end


# Infimum and supremum of an interval
inf(a::Interval) = a.lo
sup(a::Interval) = a.hi
function inf(a::Interval)
isempty(a) && return -Inf

return a.lo
end

function sup(a::Interval)
isempty(a) && return Inf

return a.hi
end


## Functions needed for generic linear algebra routines to work
Expand Down

0 comments on commit 4116481

Please sign in to comment.