Skip to content

Conversation

@gbaraldi
Copy link
Member

Fixes #32792.
To fix it I had to add precision to complex types, I can split it into two different PRs if necessary

@vtjnash
Copy link
Member

vtjnash commented Jan 21, 2022

How is it we end up attempting to create a TwicePrecision{Complex} instead of a Complex{TwicePrecision}? Is this because we refused to make TwicePrecision a Number?

@gbaraldi
Copy link
Member Author

gbaraldi commented Jan 21, 2022

I have no idea. In the TwicePrecision code there is nothing related to complex numbers, so I think it works because of julia magic, until it gets to methods that specifically use IEEEFloat when it gives the method error in the issue

Also this fix needs a change, because when building, when it reaches twiceprecision it doesn't know what a complex number is and crashes

@dkarrasch dkarrasch added needs tests Unit tests are required for this change ranges Everything AbstractRange labels Jan 21, 2022
@mcabbott
Copy link
Contributor

Is it possible just to make sure complex numbers are never used? range(1, 2+0im; length=3) does not make a StepRangeLen, and so perhaps λ .* xx should also only make one for real λ, and xx .+ yy should be more careful when promoting.

@nsajko nsajko added the complex Complex numbers label Jul 15, 2024
@mbauman
Copy link
Member

mbauman commented Jul 15, 2024

I suspect this has the same problem as #55113 — it successfully constructs the object but will perform erroneous arithmetic (in particular division) with the resulting thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

complex Complex numbers needs tests Unit tests are required for this change ranges Everything AbstractRange

Projects

None yet

Development

Successfully merging this pull request may close these issues.

complex-valued broadcasting broken with StepRangeLen

6 participants