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 complex number support to sign #556

Merged
merged 2 commits into from
Dec 13, 2022
Merged

Add complex number support to sign #556

merged 2 commits into from
Dec 13, 2022

Conversation

kgryte
Copy link
Contributor

@kgryte kgryte commented Dec 12, 2022

This PR

  • adds complex number support to sign.
  • defines the sign to be x/|x| ensuring a consistent definition for real and complex data types (as discussed in Computing the sign of a complex number #545).
  • closes Computing the sign of a complex number #545.
  • requires that special cases follow the rules of complex number division. In this case, the numerator is a complex number and the denominator a real value and, thus, complex number division is well-defined.
  • updates the input array data type to be any numeric data type, not just real-valued data types.
  • adds a special case for real-valued inputs in that NaN should be returned if x_i is NaN.
  • depends on Add support for complex number division #554.

@kgryte kgryte added API change Changes to existing functions or objects in the API. topic: Complex Data Types Complex number data types. labels Dec 12, 2022
@kgryte kgryte added this to the v2022 milestone Dec 12, 2022
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

This looks consistent with what was discussed in the linked issue. LGTM, in it goes. Thanks @kgryte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change Changes to existing functions or objects in the API. topic: Complex Data Types Complex number data types.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Computing the sign of a complex number
2 participants