Skip to content

Commit bc014ed

Browse files
committed
to_index for RealInfinity
1 parent 8580d78 commit bc014ed

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-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 = "Infinities"
22
uuid = "e1ba4f0e-776d-440f-acd9-e1d2e9742647"
33
authors = ["Sheehan Olver <[email protected]>"]
4-
version = "0.1.8"
4+
version = "0.1.9"
55

66
[compat]
77
Aqua = "0.8"

src/Infinities.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ max(::RealInfinity, ::Infinity) = ∞
243243
min(::Infinity, x::RealInfinity) = x
244244
max(::Infinity, x::RealInfinity) =
245245

246-
246+
Base.to_index(i::RealInfinity) = convert(Integer, i)
247247

248248
######
249249
# ComplexInfinity

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ end
205205
@test convert(Float16, -∞) Float16(-∞) -Inf16
206206
@test convert(BigFloat, -∞)::BigFloat == BigFloat(-∞)::BigFloat == -BigFloat(Inf)
207207
end
208+
209+
@test Base.to_index(RealInfinity()) ℵ₀
208210
end
209211

210212
@testset "ComplexInfinity" begin

0 commit comments

Comments
 (0)