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

Add round(::Type{Complex{T}}, Complex{S}) #47128

Closed
wants to merge 1 commit into from

Conversation

staticfloat
Copy link
Member

This is useful for doing things like round.(Complex{Int16}, complex_data), when you need to coerce to a single datatype.

This is useful for doing things like `round.(Complex{Int16}, complex_data)`,
when you need to coerce to a single datatype.
@staticfloat
Copy link
Member Author

Requesting review from @stevengj because GitHub suggested it. Feel free to point me toward someone else who might be more appropriate if necessary.

@gbaraldi
Copy link
Member

@staticfloat have you seen #42060

@@ -1100,6 +1100,11 @@ function round(z::Complex, rr::RoundingMode=RoundNearest, ri::RoundingMode=rr; k
round(imag(z), ri; kwargs...))
end

function round(::Type{Complex{T}}, z::Complex) where {T}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this take an optional r::RoundingMode argument?

(That starts to get into the question of defining complex floor from #42060?)

LilithHafner pushed a commit that referenced this pull request Aug 7, 2023
@giordano giordano deleted the sf/complex_rounding branch February 25, 2024 21:42
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

Successfully merging this pull request may close these issues.

3 participants