Skip to content

Commit 577adfb

Browse files
authored
Fix ambigiuity in ℵ₀ - (-∞) (#17)
1 parent 4c038b0 commit 577adfb

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
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.2"
4+
version = "0.1.3"
55

66
[compat]
77
julia = "1"

src/cardinality.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ for op in (:+, :-)
161161
@eval begin
162162
$op(x::Number, ::InfiniteCardinal) = $op(x, ∞)
163163
$op(::InfiniteCardinal, x::Number) = $op(∞, x)
164+
$op(x::RealInfinity, ::InfiniteCardinal) = $op(x, ∞)
165+
$op(::InfiniteCardinal, x::RealInfinity) = $op(∞, x)
164166
end
165167
end
166168

test/test_cardinality.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ using Infinities, Base64, Base.Checked, Test
102102
@test ℵ₀ + 5.1
103103
@test 5.1 + ℵ₀
104104
@test 5.1 - ℵ₀ -
105+
106+
@test ℵ₀ + RealInfinity() ==
107+
@test ℵ₀ - (-∞) ==
108+
@test RealInfinity() + ℵ₀ ==
105109
end
106110

107111
@testset "fld/cld/div/mod" begin

0 commit comments

Comments
 (0)