floor
floorβ
descriptionβ
Syntaxβ
BIGINT floor(DOUBLE x)
Returns the largest integer value less than or equal to x
.
tip
Another alias for this function is dfloor
.
exampleβ
mysql> select floor(1);
+------------+
| floor(1.0) |
+------------+
| 1 |
+------------+
mysql> select floor(2.4);
+------------+
| floor(2.4) |
+------------+
| 2 |
+------------+
mysql> select floor(-10.3);
+--------------+
| floor(-10.3) |
+--------------+
| -11 |
+--------------+
keywordsβ
FLOOR, DFLOOR