Array API compatible wrapper for :py:func:`np.ceil `. See its docstring for more information.
(x: Array, /)
| 228 | |
| 229 | |
| 230 | def ceil(x: Array, /) -> Array: |
| 231 | """ |
| 232 | Array API compatible wrapper for :py:func:`np.ceil <numpy.ceil>`. |
| 233 | |
| 234 | See its docstring for more information. |
| 235 | """ |
| 236 | if x.dtype not in _real_numeric_dtypes: |
| 237 | raise TypeError("Only real numeric dtypes are allowed in ceil") |
| 238 | if x.dtype in _integer_dtypes: |
| 239 | # Note: The return dtype of ceil is the same as the input |
| 240 | return x |
| 241 | return Array._new(np.ceil(x._array)) |
| 242 | |
| 243 | |
| 244 | def conj(x: Array, /) -> Array: |