Skip to content

Add support for complex number addition #525

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

Merged
merged 2 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update copy
  • Loading branch information
kgryte committed Nov 27, 2022
commit 00e85dbcbcdd13d2fc5934b65838aa7fe229d3e6
2 changes: 1 addition & 1 deletion spec/API_specification/array_api/array_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def __add__(self: array, other: Union[int, float, array], /) -> array:
| **a + bj** | (a+c) + bj | a + (b+d)j | (a+c) + (b+d)j |
+------------+------------+------------+----------------+

For complex floating-point operands, real-valued floating-point special cases must independently apply to the real and imaginary component operations described in the above table. For example, let ``a = real(x1_i)``, ``b = imag(x1_i)``, ``c = real(x2_i)``, ``d = imag(x2_i)``, and
For complex floating-point operands, real-valued floating-point special cases must independently apply to the real and imaginary component operations involving real numbers as described in the above table. For example, let ``a = real(x1_i)``, ``b = imag(x1_i)``, ``c = real(x2_i)``, ``d = imag(x2_i)``, and

- If ``a`` is ``-0`` and ``c`` is ``-0``, the real component of the result is ``-0``.
- Similarly, if ``b`` is ``+0`` and ``d`` is ``-0``, the imaginary component of the result is ``+0``.
Expand Down
2 changes: 1 addition & 1 deletion spec/API_specification/array_api/elementwise_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def add(x1: array, x2: array, /) -> array:
| **a + bj** | (a+c) + bj | a + (b+d)j | (a+c) + (b+d)j |
+------------+------------+------------+----------------+

For complex floating-point operands, real-valued floating-point special cases must independently apply to the real and imaginary component operations described in the above table. For example, let ``a = real(x1_i)``, ``b = imag(x1_i)``, ``c = real(x2_i)``, ``d = imag(x2_i)``, and
For complex floating-point operands, real-valued floating-point special cases must independently apply to the real and imaginary component operations involving real numbers as described in the above table. For example, let ``a = real(x1_i)``, ``b = imag(x1_i)``, ``c = real(x2_i)``, ``d = imag(x2_i)``, and

- If ``a`` is ``-0`` and ``c`` is ``-0``, the real component of the result is ``-0``.
- Similarly, if ``b`` is ``+0`` and ``d`` is ``-0``, the imaginary component of the result is ``+0``.
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy