dpnp.remainder
- dpnp.remainder(x1, x2, /, out=None, *, where=True, order='K', dtype=None, subok=True, **kwargs)[source]
Return element-wise remainder of division.
For full documentation refer to
numpy.remainder.- Returns:
out – The element-wise remainder of the quotient floor_divide(x1, x2).
- Return type:
dpnp.ndarray
Limitations
Parameters x1 and x2 are supported as either scalar,
dpnp.ndarrayordpctl.tensor.usm_ndarray, but both x1 and x2 can not be scalars at the same time. 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.fmodCalculate the element-wise remainder of division.
dpnp.divideStandard division.
dpnp.floorRound a number to the nearest integer toward minus infinity.
dpnp.floor_divideCompute the largest integer smaller or equal to the division of the inputs.
dpnp.modCalculate the element-wise remainder of division.
Examples
>>> import dpnp as np >>> np.remainder(np.array([4, 7]), np.array([2, 3])) array([0, 1])
>>> np.remainder(np.arange(7), 5) array([0, 1, 2, 3, 4, 0, 1])
The
%operator can be used as a shorthand forremainderondpnp.ndarray.>>> x1 = np.arange(7) >>> x1 % 5 array([0, 1, 2, 3, 4, 0, 1])