larray.fix

larray.fix(*args, **kwargs)

Round to nearest integer towards zero.

larray specific variant of numpy.fix.

Documentation from numpy:

Round an array of floats element-wise to nearest integer towards zero. The rounded values are returned as floats.

Parameters
xarray_like

An array of floats to be rounded

yndarray, optional

Output array

Returns
outndarray of floats

The array of rounded numbers

See also

trunc, floor, ceil
around

Round to given number of decimals

Examples

>>> np.fix(3.14)
3.0
>>> np.fix(3)
3.0
>>> np.fix([2.1, 2.9, -2.1, -2.9])
array([ 2.,  2., -2., -2.])