def fix(x, y=None):
x = nx.asanyarray(x)<EOL>y1 = nx.floor(x)<EOL>y2 = nx.ceil(x)<EOL>if y is None:<EOL><INDENT>y = nx.asanyarray(y1)<EOL><DEDENT>y[...] = nx.where(x >= <NUM_LIT:0>, y1, y2)<EOL>return y<EOL>
Round to nearest integer towards zero.

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

Parameters
----------
x : array_like
    An array of floats to be rounded
y : ndarray, optional
    Output array

Returns
-------
out : ndarray 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.])