Floor

Explanation
This function rounds down (as in 'down to the floor') the number to the nearest integer number, so the floor of 10.4 is 10 but the floor of 10.99 is also 10. This function is particularly useful when checking for random numbers, because random(x) can return a real number (5.65, 10.3, etc.), you can use floor to round the number to an integer number.

Examples
Here are some example values:

floor(4.120213) will return 4 floor(4.6585) will return 4 floor(-12.323) will return -13 floor(-0.01) will return -1 floor(0) will return 0

The floor function is often used in conjunction with to make some choices. Here is an example:

selection = floor(random(3)) switch (selection) { case 0: // 0 was selected because if it was 0.x, it would be rounded down break; case 1: // 1 was selected because if it was 1.x, it would be rounded down break; case 2: // 2 was selected because if it was 2.x, it would be rounded down break; }