Skip to content

Commit

Permalink
==(DecoratedInterval,Interavl) == false
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelraz committed Sep 19, 2018
1 parent e197643 commit 3fdc8ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/decorations/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ end

in(x::T, a::DecoratedInterval) where T<:Real = in(x, interval_part(a))

@inline Base.:(==)(xx::DecoratedInterval, yy::Interval) = false
@inline Base.:(==)(y::Interval, xx::DecoratedInterval) = false


## scalar functions: mig, mag and friends
scalar_functions = (
Expand Down
6 changes: 6 additions & 0 deletions test/decoration_tests/decoration_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ let b
# @test_throws ArgumentError DecoratedInterval(BigInt(1), 1//10)
# @test_throws ArgumentError @decorated(BigInt(1), 1//10)

#Issue 219
@test ==(DecoratedInterval(2,3),Interval(1,2)) == false
@test ==(Interval(-1,5), DecoratedInterval(4,5)) == false
@test ==(nai(), DecoratedInterval(-1,∞)) == false
@test ==(DecoratedInterval(3,4),nai()) == false

# Tests related to powers of decorated Intervals
@test @decorated(2,3) ^ 2 == DecoratedInterval(4, 9)
@test @decorated(2,3) ^ -2 == DecoratedInterval(1/9,1/4)
Expand Down

0 comments on commit 3fdc8ee

Please sign in to comment.