Contents Previous Next Subchapters

Largest Integer Less Than or Equal a Specified Value
Syntax floor(x)
See Also ceil , roundoff , int , mod

Description
Returns the element-by-element largest integer that is less than or equal the corresponding element of x where x is an integer, real, or double-precision matrix.

Example
     y = [ -1.4, -.6, 1.4, 2.] 
     floor(y)
returns
     [-2 , -1 , 1 , 2]

Reference
Note that the elements of the return value are integers but the return value has the same type as x.

Mlmode
In Mlmode , x can also be a logical, character or complex matrix. In the complex case, the floor function applies to the real and imaginary parts separately.