diff --git a/Project.toml b/Project.toml index e873924..6f90dae 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Infinities" uuid = "e1ba4f0e-776d-440f-acd9-e1d2e9742647" authors = ["Sheehan Olver "] -version = "0.1.3" +version = "0.1.4" [compat] julia = "1" diff --git a/src/cardinality.jl b/src/cardinality.jl index da4f93d..3ba65bb 100644 --- a/src/cardinality.jl +++ b/src/cardinality.jl @@ -163,6 +163,8 @@ for op in (:+, :-) $op(::InfiniteCardinal, x::Number) = $op(∞, x) $op(x::RealInfinity, ::InfiniteCardinal) = $op(x, ∞) $op(::InfiniteCardinal, x::RealInfinity) = $op(∞, x) + $op(::Infinity, ::InfiniteCardinal) = $op(∞, ∞) + $op(::InfiniteCardinal, ::Infinity) = $op(∞, ∞) end end diff --git a/test/test_cardinality.jl b/test/test_cardinality.jl index 02d89ec..4091c15 100644 --- a/test/test_cardinality.jl +++ b/test/test_cardinality.jl @@ -102,7 +102,9 @@ using Infinities, Base64, Base.Checked, Test @test ℵ₀ + 5.1 ≡ ∞ @test 5.1 + ℵ₀ ≡ ∞ @test 5.1 - ℵ₀ ≡ -∞ - + + @test ℵ₀ + ∞ == ∞ + @test ∞ + ℵ₀ == ∞ @test ℵ₀ + RealInfinity() == ∞ @test ℵ₀ - (-∞) == ∞ @test RealInfinity() + ℵ₀ == ∞