Skip to content

Commit 2b3d92c

Browse files
committed
fix .. for irrational inputs
1 parent 24a0b66 commit 2b3d92c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/intervals/intervals.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ end
151151

152152
function ..(a::Irrational{T}, b::S) where {T, S}
153153
R = promote_type(Irrational{T}, S)
154-
return Interval(R(a, RoundDown), atomic(Interval{R}, b).hi)
154+
return interval(R(a, RoundDown), atomic(Interval{R}, b).hi)
155155
end
156156

157157
function ..(a::Irrational{T}, b::Irrational{S}) where {T, S}
158158
R = promote_type(Irrational{T}, Irrational{S})
159-
return Interval(a, b)
159+
return interval(a, b)
160160
end
161161

162162
# ..(a::Integer, b::Integer) = interval(a, b)

test/interval_tests/construction.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ end
236236

237237
a = big(0.1)..2
238238
@test typeof(a) == Interval{BigFloat}
239+
240+
@test_throws ArgumentError 2..1
241+
@test_throws ArgumentError π..1
242+
@test_throws ArgumentError π..eeuler
239243
end
240244

241245
@testset "± tests" begin

0 commit comments

Comments
 (0)