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.ndarray or dpctl.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.remainder

Remainder complementary to floor_divide.

dpnp.divide

Standard division.

dpnp.floor

Round a number to the nearest integer toward minus infinity.

dpnp.ceil

Round 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 for floor_divide on dpnp.ndarray.

>>> x1 = np.array([1., 2., 3., 4.])
>>> x1 // 2.5
array([0., 0., 1., 1.])