diff --git a/Project.toml b/Project.toml index cf21bab..026c56c 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.1" +version = "0.1.2" [compat] julia = "1" diff --git a/src/cardinality.jl b/src/cardinality.jl index 6b87b67..62463bc 100644 --- a/src/cardinality.jl +++ b/src/cardinality.jl @@ -82,6 +82,8 @@ isless(x::InfiniteCardinal, y::AbstractFloat) = false <(::InfiniteCardinal, x::Real) = false ≤(::InfiniteCardinal{0}, x::Real) = ∞ ≤ x ≤(::InfiniteCardinal, x::Real) = false +≤(::InfiniteCardinal{0}, x::RealInfinity) = ∞ ≤ x +≤(::InfiniteCardinal, x::RealInfinity) = false >(::InfiniteCardinal{0}, y::Real) = ∞ > y >(::InfiniteCardinal, ::Real) = true ≥(::InfiniteCardinal, ::Real) = true diff --git a/test/test_cardinality.jl b/test/test_cardinality.jl index f0379c7..690530a 100644 --- a/test/test_cardinality.jl +++ b/test/test_cardinality.jl @@ -56,6 +56,9 @@ using Infinities, Base64, Base.Checked, Test @test !(-∞ > ℵ₀) && !(-∞ ≥ ℵ₀) @test ℵ₀ > -∞ @test ℵ₁ > -∞ && ℵ₁ ≥ -∞ + @test ℵ₀ ≤ RealInfinity() + @test !(ℵ₀ ≤ -∞) + @test !(ℵ₁ ≤ RealInfinity()) @test Inf < ℵ₁ && !(ℵ₁ < Inf) @test !(Inf < ℵ₀) && !(ℵ₀ < Inf)