Skip to content

Add complex number support to sum - #538

Merged
rgommers merged 2 commits into
mainfrom
cmplx-sum
Dec 13, 2022
Merged

Add complex number support to sum#538
rgommers merged 2 commits into
mainfrom
cmplx-sum

Conversation

@kgryte

@kgrytekgryte commented Dec 1, 2022

Copy link
Copy Markdown
Contributor

This PR

  • adds support for complex number summation. As described in Add support for complex number addition #525, complex number addition is well-defined, where (a + bj) + (c + dj) = (a+c) + (c+d)j.
  • specifies that special cases be derived as if the operation was implemented as a reduction over add.
  • requires that, if x is a complex floating-point data type and dtype is None, the function must return an array having the default complex floating-point data type.
  • updates the input and output array data types to be any numeric data type, not just real-valued data types.
  • depends on Add support for complex number addition #525.

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

@rgommersrgommers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice that the special cases compose. This LGTM, thanks @kgryte

@rgommers
rgommers merged commit f96cd18 into mainDec 13, 2022
@rgommers
rgommers deleted the cmplx-sum branch December 13, 2022 16:56
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API changeChanges to existing functions or objects in the API.topic: Complex Data TypesComplex number data types.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kgryte@rgommers