dpnp.trunc
- dpnp.trunc(x1, out=None, **kwargs)[source]
Compute the truncated value of the input, element-wise.
For full documentation refer to
numpy.trunc.Limitations
Parameter
x1is supported asdpnp.ndarray. Keyword argumentskwargsare 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.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 >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]) >>> result = np.trunc(a) >>> [x for x in result] [-1.0, -1.0, -0.0, 0.0, 1.0, 1.0, 2.0]