Contents Previous Next Subchapters

Rounding Numbers To The Nearest Integer
Syntax roundoff(x)
See Also round , int , floor , mod

Description
Returns the element-by-element integer matrix that is closest to x, where x is an integer, real, double-precision matrix.

Example
     y = [-1.4, -.6, .6, 1.4, 1.6]
     print roundoff(y)
returns
     [-1 , -1 , 1 , 1 , 2]

Reference
The return value of roundoff is an integer matrix while the return value of round(x) has the same type as x