Skip to content

Add complex number support to APIs for returning unique elements - #540

Merged
rgommers merged 1 commit into
mainfrom
cmplx-unique
Dec 13, 2022
Merged

Add complex number support to APIs for returning unique elements#540
rgommers merged 1 commit into
mainfrom
cmplx-unique

Conversation

@kgryte

Copy link
Copy Markdown
Contributor

This PR

  • adds complex number support to unique_all, unique_counts, unique_inverse, and unique_values. This PR builds on Add complex number support to equal #528. Namely, by convention, equality is determined by independently comparing real and imaginary components respectively and then performing a logical AND (i.e., if x = a + bj and y = c + dj, then x == y iff a == c AND b == d.
  • requires that complex numbers having at least one component which is NaN be considered unique.
  • as this PR builds on Add complex number support to equal #528, this PR does not support the one-infinity model (see C99) where complex infinites are treated as equal.

@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.

LGTM, thanks @kgryte

@rgommers
rgommers merged commit 770b53b into mainDec 13, 2022
@rgommers
rgommers deleted the cmplx-unique branch December 13, 2022 21:03
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