Link Search Menu Expand Document

Math.floor methods

Explanation Find the value rounded down to the nearest whole number.
Returns the largest integer equal to or less than x
Call format var v = Math.floor (x)
Return value Returns an integer rounded down to the nearest whole number.
Arguments Number x Value to round down to the nearest whole number
Exception None
Example of use
print (Math.floor (0.9), "¥ n");   / * 0 * /
print (Math.floor (1.0), "¥ n");   / * 1 * /
print (Math.floor (1.1), "¥ n");   / * 1 * /
 
print (Math.floor (-0.9), "¥ n"); / * -1 * /
print (Math.floor (-1.0), "¥ n"); / * becomes -1 * /
print (Math.floor (-1.1), "¥ n"); / * -2 * /
Related item ceil, round methods