dpnp.floor_divide
- dpnp.floor_divide(x1, x2, /, out=None, *, where=True, order='K', dtype=None, subok=True, **kwargs)[source]
Compute the largest integer smaller or equal to the division of the inputs.
For full documentation refer to
numpy.floor_divide.- Returns:
out – The floordivide of each element of x.
- 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.remainderRemainder complementary to floor_divide.
dpnp.divideStandard division.
dpnp.floorRound a number to the nearest integer toward minus infinity.
dpnp.ceilRound a number to the nearest integer toward infinity.
Examples
>>> import dpnp as np >>> np.floor_divide(np.array([1, -1, -2, -9]), -2) array([-1, 0, 1, 4])
>>> np.floor_divide(np.array([1., 2., 3., 4.]), 2.5) array([ 0., 0., 1., 1.])
The
//operator can be used as a shorthand forfloor_divideondpnp.ndarray.>>> x1 = np.array([1., 2., 3., 4.]) >>> x1 // 2.5 array([0., 0., 1., 1.])