trunc#

rbc.stdlib.elementwise_functions.trunc(x)#

Rounds each element x_i of the input array x to the nearest integer-valued number that is closer to zero than x_i.

Examples

>>> from rbc.stdlib import array_api
>>> @heavydb('double(double)')
... def array_api_trunc(x):
...     return array_api.trunc(x)
>>> array_api_trunc(np.pi).execute()
3.0

Array-API ‘trunc’ doc