-
Notifications
You must be signed in to change notification settings - Fork 51
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 floating-point data types #418
Conversation
Why aren't complex types considered numeric data types? Is this is because they lack inherent total order, than the "numeric data types" is a misnomer and should be renamed to "data types with canonical ordering" or some such |
@oleksandr-pavlyk Updated the PR. Had originally shied away from changing the dtypes belonging to "numeric" as this implied a change to the semantic meaning for purposes of the spec. However, after discussion, this was not seen as a problem. Added a "real-valued data types" category and have updated the spec accordingly. |
This change ensures that the specification maintains the status quo in terms of accepted dtypes for the current set of APIs. Subsequent PRs will add support to APIs for complex number data types on a case-by-case basis.
This is still confusing... A lot of dunder methods like |
@leofang For many of the APIs, "real-valued data types" is a placeholder and each API will be updated on an individual basis in subsequent PRs. The purpose of this PR is to solely update the list of data types. Because of the change to the data type categories (e.g., |
Ah ok, I missed the updated PR description:
Thanks, Athan! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks, @leofang! I'll leave it open for another day or so before merging. And then we'll get the ball moving on the rest of the complex number support updates. 😅 |
Question: Is the complex-number support counted as extension or required? If it's extension, then does it mean all APIs supporting complex numbers become extension as well? |
@leofang Complex number support would be required. Because of how deeply intertwined dtype support is with all APIs in the spec, allowing complex number to be an extension does not seem to make sense (e.g., how would I ascertain whether a given array API supports complex numbers in a portable fashion?). |
As this PR has been approved and up for review for 4 weeks, will merge. Any further revisions may be addressed in follow-up PRs... |
This PR
complex64
andcomplex128
data types to the specification, as outlined in RFC: Adding complex number support to the specification #373.complex64
as a single-precision (64-bit) complex floating-point number whose real and imaginary components must be IEEE 754 single-precision (32-bit) binary floating-point numbers.complex128
as a double-precision (128-bit) complex floating-point number whose real and imaginary components must be IEEE 754 double-precision (64-bit) binary floating-point numbers.float32
, the default complex floating-point data type must becomplex64
).complex64
andcomplex128
to the list of "numeric" data types.