跳到主要内容
跳到主要内容

floor

floor

description

Syntax

BIGINT floor(DOUBLE x) 返回小于或等于x的最大整数值.

提示

该函数的另一个别名为 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