-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/ceiling.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# **CEILING()** | ||
|
||
## **Description** | ||
|
||
The CEILING(X) function returns the smallest integer value not less than X.Synonymous with [`CEIL()`](ceil.md). | ||
|
||
## **Syntax** | ||
|
||
``` | ||
> CEILING(X) | ||
``` | ||
|
||
## **Arguments** | ||
|
||
| Arguments | Description | | ||
| ---- | ---- | | ||
| X | Required. Any numeric data type supported now. | | ||
|
||
For exact-value numeric arguments, the return value has an exact-value numeric type. For floating-point arguments, the return value has a floating-point type. | ||
|
||
## **Examples** | ||
|
||
```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) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters