round to nearest integer
y=round(x)
real or complex matrix
integer value matrix (or complex matrix with integer real and imaginary part)
round(x)
rounds the elements of
x
to the nearest integers.
In case of tie, this function rounds to infinities.
That is, if x
is positive and is halfway between two
integers, then round(x)
is rounded toward %inf
.
If x
is negative and is halfway between two
integers, then round(x)
is rounded toward -%inf
.
In other words, if x
is positive, then round(x)
is equal to int(x+0.5)
, and if x
is negative,
then round(x)
is equal to int(x-0.5)