floor

Returns the given number rounded down to the nearest integer.

Syntax:

floor(n);


Argument Description
n The number to floor.


Returns: Real


Description

Returns the floor of n, that is, n rounded down to an integer. This is similar to the round() function, but it only rounds down, no matter what the decimal value, so floor(5.99999) will return 5, as will floor(5.2), floor(5.6457) etc...


Example:

val = floor( 3.9 );

This will set val to 3.


Back: Real Number Functions
Next: frac
© Copyright YoYo Games Ltd. 2018 All Rights Reserved