Skip to content

Commit

Permalink
min/maximum(abs)
Browse files Browse the repository at this point in the history
  • Loading branch information
aplavin committed Feb 14, 2024
1 parent 0f74402 commit 27ed4aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/IntervalSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ maximum(d::TypedEndpointsInterval{L,:open}) where L = throw(ArgumentError("$d is

extrema(I::TypedEndpointsInterval) = (infimum(I), supremum(I))

minimum(::typeof(abs), I::TypedEndpointsInterval{:closed,:closed}) =

Check warning on line 340 in src/IntervalSets.jl

View check run for this annotation

Codecov / codecov/patch

src/IntervalSets.jl#L340

Added line #L340 was not covered by tests
minimum(I) < 0 < maximum(I) ?
zero(minimum(I)) :
minimum(abs, endpoints(I))
maximum(::typeof(abs), I::TypedEndpointsInterval{:closed,:closed}) = maximum(abs, endpoints(I))

Check warning on line 344 in src/IntervalSets.jl

View check run for this annotation

Codecov / codecov/patch

src/IntervalSets.jl#L344

Added line #L344 was not covered by tests

# Open and closed at endpoints
isleftclosed(d::TypedEndpointsInterval{:closed}) = true
isleftclosed(d::TypedEndpointsInterval{:open}) = false
Expand Down

0 comments on commit 27ed4aa

Please sign in to comment.