Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparing ℵ₀ and #41

Open
putianyi889 opened this issue Jun 9, 2023 · 5 comments
Open

Comparing ℵ₀ and #41

putianyi889 opened this issue Jun 9, 2023 · 5 comments

Comments

@putianyi889
Copy link

Does these mean ℵ₀ is strictly greater than while they are also equal? What is the purpose behind it?

@test ℵ₀ ==&&== ℵ₀

@test !(∞ < ℵ₀) && ℵ₀

@test min(∞,ℵ₀) min(ℵ₀,∞)
@test max(∞,ℵ₀) max(ℵ₀,∞) ℵ₀

https://github.com/JuliaLang/julia/blob/43d7f881f8e26eb4bb7ef3d6f84b378d28125325/base/promotion.jl#L532-L533

@dlfivefifty
Copy link
Member

Where do you get "strictly greater than"?

@dlfivefifty
Copy link
Member

It actually says "not strictly greater than"

@putianyi889
Copy link
Author

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.

@dlfivefifty
Copy link
Member

Not always:

julia> min(1.0, 1)
1.0

julia> min(1, 1.0)
1.0

@putianyi889
Copy link
Author

It's because of promotion

min(x::Real, y::Real) = min(promote(x,y)...) # promotion.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants