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
- If ``self`` is either ``+0`` or ``-0``, the result is ``False``.
216
229
217
230
For complex floating-point operands, special cases must be handled as if the operation is implemented as the logical AND of ``bool(real(self))`` and ``bool(imag(self))``.
231
+
"""
232
+
233
+
def__complex__(self: array, /) ->complex:
234
+
"""
235
+
Converts a zero-dimensional array to a Python ``complex`` object.
Converts a zero-dimensional array to a Python ``int`` object.
513
522
523
+
Parameters
524
+
----------
525
+
self: array
526
+
zero-dimensional array instance. Should have a real-valued or boolean data type. If ``self`` has a complex floating-point data type, the function must raise a ``TypeError``.
527
+
528
+
Returns
529
+
-------
530
+
out: int
531
+
a Python ``int`` object representing the single element of the array instance.
- If ``self`` is a finite number, the result is the integer part of ``self``.
524
546
- If ``self`` is ``-0``, the result is ``0``.
525
547
526
-
Parameters
527
-
----------
528
-
self: array
529
-
zero-dimensional array instance. Should have a real-valued or boolean data type. If ``self`` has a complex floating-point data type, the function must raise a ``TypeError``.
530
-
531
-
Returns
532
-
-------
533
-
out: int
534
-
a Python ``int`` object representing the single element of the array instance.
0 commit comments