diff --git a/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/ceil.md b/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/ceil.md index aa0038da95..4bb5c537d5 100644 --- a/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/ceil.md +++ b/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/ceil.md @@ -2,7 +2,7 @@ ## **函数说明** -CEIL(X) 函数返回不小于 X 的最小整数。 +CEIL(X) 函数返回不小于 X 的最小整数。与 [`CEILING()`](ceiling.md) 同义。 ## **函数语法** diff --git a/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/ceiling.md b/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/ceiling.md new file mode 100644 index 0000000000..892f747e6e --- /dev/null +++ b/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/ceiling.md @@ -0,0 +1,65 @@ +# **ceiling()** + +## **函数说明** + +ceiling(X) 函数返回不小于 X 的最小整数。[`ceil()`](ceil.md) 同义。 + +## **函数语法** + +``` +> ceiling(X) +``` + +## **参数释义** + +| 参数 | 说明 | +| ---- | ---- | +| X | 必要参数,可取任意数值数据类型 | + +对 int 类的绝对数值类型,返回值也是相同的绝对数值类型。对浮点数来说,返回值也是浮点数。 + +## **示例** + +```sql +drop table if exists t1; +create table t1(a int ,b float); +insert into t1 values(1,0.5); +insert into t1 values(2,0.499); +insert into t1 values(3,0.501); +insert into t1 values(4,20.5); +insert into t1 values(5,20.499); +insert into t1 values(6,13.500); +insert into t1 values(7,-0.500); +insert into t1 values(8,-0.499); +insert into t1 values(9,-0.501); +insert into t1 values(10,-20.499); +insert into t1 values(11,-20.500); +insert into t1 values(12,-13.500); + +mysql> select a,ceiling(b) from t1; ++------+------------+ +| a | ceiling(b) | ++------+------------+ +| 1 | 1 | +| 2 | 1 | +| 3 | 1 | +| 4 | 21 | +| 5 | 21 | +| 6 | 14 | +| 7 | -0 | +| 8 | -0 | +| 9 | -0 | +| 10 | -20 | +| 11 | -20 | +| 12 | -13 | ++------+------------+ +12 rows in set (0.00 sec) + +mysql> select sum(ceiling(b)) from t1; ++-----------------+ +| sum(ceiling(b)) | ++-----------------+ +| 6 | ++-----------------+ +1 row in set (0.01 sec) +``` diff --git a/docs/MatrixOne/Reference/Functions-and-Operators/matrixone-function-list.md b/docs/MatrixOne/Reference/Functions-and-Operators/matrixone-function-list.md index 9102661855..f9b6a42893 100644 --- a/docs/MatrixOne/Reference/Functions-and-Operators/matrixone-function-list.md +++ b/docs/MatrixOne/Reference/Functions-and-Operators/matrixone-function-list.md @@ -66,6 +66,7 @@ | [ACOS()](./Mathematical/acos.md) | 用于求给定数值的余弦(用弧度表示) | | [ATAN()](./Mathematical/atan.md) | 用于求给定数值的反正切(用弧度表示)| | [CEIL()](./Mathematical/ceil.md) | 用于求不小于参数的最小整数。| +| [CEILING()](./Mathematical/ceiling.md) | 用于求不小于参数的最小整数。| | [COS()](./Mathematical/cos.md) | 用于求输入参数(用弧度表示)的余弦值。| | [COT()](./Mathematical/cot.md) | 用于求输入参数(用弧度表示)的余切值。 | | [EXP()](./Mathematical/exp.md) | 用于求以自然常数 e 为底的 number 的指数。| diff --git a/mkdocs.yml b/mkdocs.yml index 075429b69b..5291edc150 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -563,6 +563,7 @@ nav: - ACOS(): MatrixOne/Reference/Functions-and-Operators/Mathematical/acos.md - ATAN(): MatrixOne/Reference/Functions-and-Operators/Mathematical/atan.md - CEIL(): MatrixOne/Reference/Functions-and-Operators/Mathematical/ceil.md + - CEILING(): MatrixOne/Reference/Functions-and-Operators/Mathematical/ceiling.md - COS(): MatrixOne/Reference/Functions-and-Operators/Mathematical/cos.md - COT(): MatrixOne/Reference/Functions-and-Operators/Mathematical/cot.md - EXP(): MatrixOne/Reference/Functions-and-Operators/Mathematical/exp.md