Array API compatible wrapper for :py:func:`np.floor `. See its docstring for more information.
(x: Array, /)
| 323 | |
| 324 | |
| 325 | def floor(x: Array, /) -> Array: |
| 326 | """ |
| 327 | Array API compatible wrapper for :py:func:`np.floor <numpy.floor>`. |
| 328 | |
| 329 | See its docstring for more information. |
| 330 | """ |
| 331 | if x.dtype not in _real_numeric_dtypes: |
| 332 | raise TypeError("Only real numeric dtypes are allowed in floor") |
| 333 | if x.dtype in _integer_dtypes: |
| 334 | # Note: The return dtype of floor is the same as the input |
| 335 | return x |
| 336 | return Array._new(np.floor(x._array)) |
| 337 | |
| 338 | |
| 339 | def floor_divide(x1: Array, x2: Array, /) -> Array: |