You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Floating-point addition is a commutative operation, but not always associative.
169
171
172
+
For complex floating-point operands, addition is defined according to the following table. For real components ``a`` and ``c`` and imaginary components ``b`` and ``d``,
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
185
+
186
+
- If ``a`` is ``-0`` and ``c`` is ``-0``, the real component of the result is ``-0``.
187
+
- Similarly, if ``b`` is ``+0`` and ``d`` is ``-0``, the imaginary component of the result is ``+0``.
188
+
189
+
Hence, if ``z1 = a + bj = -0 + 0j`` and ``z2 = c + dj = -0 - 0j``, the result of ``z1 + z2`` is ``-0 + 0j``.
190
+
170
191
Parameters
171
192
----------
172
193
self: array
173
-
array instance (augend array). Should have a real-valued data type.
194
+
array instance (augend array). Should have a numeric data type.
174
195
other: Union[int, float, array]
175
-
addend array. Must be compatible with ``self`` (see :ref:`broadcasting`). Should have a real-valued data type.
196
+
addend array. Must be compatible with ``self`` (see :ref:`broadcasting`). Should have a numeric data type.
Floating-point addition is a commutative operation, but not always associative.
186
186
187
+
For complex floating-point operands, addition is defined according to the following table. For real components ``a`` and ``c`` and imaginary components ``b`` and ``d``,
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
200
+
201
+
- If ``a`` is ``-0`` and ``c`` is ``-0``, the real component of the result is ``-0``.
202
+
- Similarly, if ``b`` is ``+0`` and ``d`` is ``-0``, the imaginary component of the result is ``+0``.
203
+
204
+
Hence, if ``z1 = a + bj = -0 + 0j`` and ``z2 = c + dj = -0 - 0j``, the result of ``z1 + z2`` is ``-0 + 0j``.
205
+
187
206
Parameters
188
207
----------
189
208
x1: array
190
-
first input array. Should have a real-valued data type.
209
+
first input array. Should have a numeric data type.
191
210
x2: array
192
-
second input array. Must be compatible with ``x1`` (see :ref:`broadcasting`). Should have a real-valued data type.
211
+
second input array. Must be compatible with ``x1`` (see :ref:`broadcasting`). Should have a numeric data type.
0 commit comments