Infinities.jl
Infinities.jl copied to clipboard
Comparing `ℵ₀` and `∞`
Does these mean ℵ₀ is strictly greater than ∞ while they are also equal? What is the purpose behind it?
https://github.com/JuliaMath/Infinities.jl/blob/0972ead14abe0eee1218c6f5b2e244775bd9e4c8/test/test_cardinality.jl#L22 https://github.com/JuliaMath/Infinities.jl/blob/0972ead14abe0eee1218c6f5b2e244775bd9e4c8/test/test_cardinality.jl#L43 https://github.com/JuliaMath/Infinities.jl/blob/0972ead14abe0eee1218c6f5b2e244775bd9e4c8/test/test_cardinality.jl#L77-L78 https://github.com/JuliaLang/julia/blob/43d7f881f8e26eb4bb7ef3d6f84b378d28125325/base/promotion.jl#L532-L533
Where do you get "strictly greater than"?
It actually says "not strictly greater than"
because Julia base defines min and max as
min(x,y) = ifelse(y < x, y, x)
max(x,y) = ifelse(y < x, x, y)
so if min(x,y) == min(y,x) == x then x must be strictly less.
Not always:
julia> min(1.0, 1)
1.0
julia> min(1, 1.0)
1.0
It's because of promotion
min(x::Real, y::Real) = min(promote(x,y)...) # promotion.jl