Skip to content

Commit 65ca77f

Browse files
authored
fix dist for decorated intervals (#458)
* fixed dist for decorated intervals * bumped patch version
1 parent e3c1d31 commit 65ca77f

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "IntervalArithmetic"
22
uuid = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
33
repo = "https://github.com/JuliaIntervals/IntervalArithmetic.jl.git"
4-
version = "0.18.1"
4+
version = "0.18.2"
55

66
[deps]
77
CRlibm = "96374032-68de-5a5b-8d9e-752f78720389"

src/decorations/functions.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@ in(x::T, a::DecoratedInterval) where T<:Real = in(x, interval(a))
4747

4848
## scalar functions: mig, mag and friends
4949
scalar_functions = (
50-
:mig, :mag, :inf, :sup, :mid, :diam, :radius, :dist, :eps, :midpoint_radius
50+
:mig, :mag, :inf, :sup, :mid, :diam, :radius, :eps, :midpoint_radius
5151
)
5252

5353
for f in scalar_functions
5454
@eval $(f)(xx::DecoratedInterval{T}) where T = $f(interval(xx))
5555
end
5656

57+
dist(xx::DecoratedInterval, yy::DecoratedInterval) = dist(interval(xx), interval(yy))
5758

5859
## Arithmetic function; / is treated separately
5960
arithm_functions = ( :+, :-, :* )

test/decoration_tests/decoration_tests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ let b
4949
@test @decorated(-3, 2)^@decorated(0.0, 1.0) == DecoratedInterval(0.0,2.0, trv)
5050
@test @decorated(-3, 2)^Interval(-1.0, 1.0) == DecoratedInterval(0.0,Inf, trv)
5151
@test @decorated(-3, 2)^@decorated(-1.0, 1.0) == DecoratedInterval(0.0, Inf, trv)
52+
53+
a = @decorated 1 2
54+
b = @decorated 3 4
55+
56+
@test dist(a, b) == 2.0
5257
end
5358

5459
@testset "Convert string to DecoratedInterval" begin

0 commit comments

Comments
 (0)