dpnp.floor
- dpnp.floor(x1, out=None, **kwargs)[source]
Round a number to the nearest integer toward minus infinity.
For full documentation refer to
numpy.floor
.Limitations
Parameter
x1
is supported asdpnp.ndarray
. Keyword argumentskwargs
are currently unsupported. Otherwise the functions will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.See also
dpnp.ceil
Compute the ceiling of the input, element-wise.
dpnp.trunc
Return the truncated value of the input, element-wise.
Notes
Some spreadsheet programs calculate the “floor-towards-zero”, in other words floor(-2.5) == -2. dpNP instead uses the definition of floor where floor(-2.5) == -3.
Examples
>>> import dpnp as np >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]) >>> result = np.floor(a) >>> [x for x in result] [-2.0, -2.0, -1.0, 0.0, 1.0, 1.0, 2.0]