Skip to content

LoadError: no promotion exists for Complex{T<:Real} and Int64 #14715

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

Closed
iagobaapellaniz opened this issue Jan 18, 2016 · 1 comment
Closed

LoadError: no promotion exists for Complex{T<:Real} and Int64 #14715

iagobaapellaniz opened this issue Jan 18, 2016 · 1 comment

Comments

@iagobaapellaniz
Copy link
Contributor

I think there are more inconsistencies of this type

Reproduce:

  1. Use the typed constructor for array Complex[ ]
  2. Try to multiply any other array such as
Complex[1 2]*[3, 4]

You will get the error

LoadError: no promotion exists for Complex{T<:Real} and Int64

There is a workaround:

Complex[1 2]*Number[3, 4]

OR TRIVIAL

Complex[1 2]*Complex[3, 4]
@JeffBezanson
Copy link
Member

I don't recommend using the Complex type; you should use a more specific type like Complex64 or Complex128 (see also #8142).

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