We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
typeof(π/Complex64(2)) == Complex128
We currently have
julia> typeof(π/Complex64(2)) Complex{Float64}
This looks like a bug to me. Compare with
julia> typeof(π*Complex64(2)) Complex{Float32} julia> typeof(π/Float32(2)) Float32
The text was updated successfully, but these errors were encountered:
typeof(\pi/Complex64(2,0)) == Complex128
It's due to this promotion rule.
We could add a promotion rule for Complex, or we could add a more generic rule. Something like:
Complex
promote_rule(::Type{<:AbstractIrrational}, ::Type{T}) where {T<:Real} = promote_type(Float64, T) promote_rule(::Type{S}, ::Type{T}) where {S<:AbstractIrrational,T<:Number} = promote_type(promote_type(S, real(T)), T)
so that non-Real number types use real to promote based on the real part.
Real
real
Sorry, something went wrong.
No branches or pull requests
We currently have
This looks like a bug to me. Compare with
The text was updated successfully, but these errors were encountered: