-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
float(::Type)
width inconsistency
#52908
Comments
Very tangentially related to #52528 (comment), where the insufficient generality of It looks like julia> zero(Base.IEEEFloat)
ERROR: MethodError: no method matching Union{Float16, Float32, Float64}(::Int64)
julia> zero(Base.promote_union(Base.IEEEFloat)) |> typeof
Float64 This won't work for a |
FTR this conflicts with the design proposed for But I guess we could fix this issue using |
float(Union{Int,BigInt})
being narrower thanBigFloat
seems like a bug.The method looks like this:
The problem is that
zero(T)
forT
that is an union doesn't behave as we would like here (xref. #34003):The text was updated successfully, but these errors were encountered: