From 9db2309325d02df05a85f5a016af766378ad8bcd Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Sun, 19 Sep 2021 12:38:48 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20ambigiuity=20in=20=E2=84=B5=E2=82=80=20-?= =?UTF-8?q?=20(-=E2=88=9E)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project.toml | 2 +- src/cardinality.jl | 2 ++ test/test_cardinality.jl | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 026c56c..e873924 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.2" +version = "0.1.3" [compat] julia = "1" diff --git a/src/cardinality.jl b/src/cardinality.jl index 62463bc..da4f93d 100644 --- a/src/cardinality.jl +++ b/src/cardinality.jl @@ -161,6 +161,8 @@ for op in (:+, :-) @eval begin $op(x::Number, ::InfiniteCardinal) = $op(x, ∞) $op(::InfiniteCardinal, x::Number) = $op(∞, x) + $op(x::RealInfinity, ::InfiniteCardinal) = $op(x, ∞) + $op(::InfiniteCardinal, x::RealInfinity) = $op(∞, x) end end diff --git a/test/test_cardinality.jl b/test/test_cardinality.jl index 690530a..02d89ec 100644 --- a/test/test_cardinality.jl +++ b/test/test_cardinality.jl @@ -102,6 +102,10 @@ using Infinities, Base64, Base.Checked, Test @test ℵ₀ + 5.1 ≡ ∞ @test 5.1 + ℵ₀ ≡ ∞ @test 5.1 - ℵ₀ ≡ -∞ + + @test ℵ₀ + RealInfinity() == ∞ + @test ℵ₀ - (-∞) == ∞ + @test RealInfinity() + ℵ₀ == ∞ end @testset "fld/cld/div/mod" begin