dpnp.rint

dpnp.rint(x, /, out=None, *, order='K', where=True, dtype=None, subok=True, **kwargs)[source]

Round elements of the array to the nearest integer.

For full documentation refer to numpy.rint.

Returns:

out – The rounded value of elements of the array to the nearest integer.

Return type:

dpnp.ndarray

Limitations

Parameter x is only supported as either dpnp.ndarray or dpctl.tensor.usm_ndarray. Parameters where, dtype and subok are supported with their default values. Keyword argument kwargs is currently unsupported. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.

See also

dpnp.round

Evenly round to the given number of decimals.

dpnp.ceil

Compute the ceiling of the input, element-wise.

dpnp.floor

Return the floor of the input, element-wise.

dpnp.trunc

Return the truncated value of the input, element-wise.

Examples

>>> import dpnp as np
>>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
>>> np.rint(a)
array([-2., -2., -0.,  0.,  2.,  2.,  2.])