Array API compatible wrapper for :py:func:`np.real `. See its docstring for more information.
(x: Array, /)
| 625 | |
| 626 | |
| 627 | def real(x: Array, /) -> Array: |
| 628 | """ |
| 629 | Array API compatible wrapper for :py:func:`np.real <numpy.real>`. |
| 630 | |
| 631 | See its docstring for more information. |
| 632 | """ |
| 633 | if x.dtype not in _complex_floating_dtypes: |
| 634 | raise TypeError("Only complex floating-point dtypes are allowed in real") |
| 635 | return Array._new(np.real(x)) |
| 636 | |
| 637 | |
| 638 | def remainder(x1: Array, x2: Array, /) -> Array: |