@@ -251,8 +251,12 @@ def __complex__(self: array, /) -> complex:
251
251
"""
252
252
Converts a zero-dimensional array to a Python ``complex`` object.
253
253
254
- .. note::
255
- If ``self`` has a boolean data type, a value of ``True`` must cast to ``1+0j``, and a value of ``False`` must cast to ``0+0j``.
254
+ **Special cases**
255
+
256
+ For boolean operands,
257
+
258
+ - If ``self`` is ``True``, the result is ``1+0j``.
259
+ - If ``self`` is ``False``, the result is ``0+0j``.
256
260
257
261
Parameters
258
262
----------
@@ -374,8 +378,12 @@ def __float__(self: array, /) -> float:
374
378
.. note::
375
379
Casting integer values outside the representable bounds of Python's float type is not specified and is implementation-dependent.
376
380
377
- .. note::
378
- If ``self`` has a boolean data type, a value of ``True`` must cast to ``1``, and a value of ``False`` must cast to ``0``.
381
+ **Special cases**
382
+
383
+ For boolean operands,
384
+
385
+ - If ``self`` is ``True``, the result is ``1``.
386
+ - If ``self`` is ``False``, the result is ``0``.
379
387
380
388
Parameters
381
389
----------
@@ -529,11 +537,13 @@ def __int__(self: array, /) -> int:
529
537
"""
530
538
Converts a zero-dimensional array to a Python ``int`` object.
531
539
532
- .. note::
533
- If ``self`` has a boolean data type, a value of ``True`` must cast to ``1``, and a value of ``False`` must cast to ``0``.
534
-
535
540
**Special cases**
536
541
542
+ For boolean operands,
543
+
544
+ - If ``self`` is ``True``, the result is ``1``.
545
+ - If ``self`` is ``False``, the result is ``0``.
546
+
537
547
For floating-point operands,
538
548
539
549
- If ``self`` is a finite number, the result is the integer part of ``self``.
0 commit comments