ceil()

返回最近整数的函数

ceil() 是一个系统函数,它返回大于或等于给定值的最小整数。

ceil() 函数于 PostgreSQL 6.5 中添加。

用法

ceil ( numeric ) → numeric
ceil ( double precision ) → double precision

ceiling() 函数是 ceil() 的别名。

变更历史

示例

关于 ceil() 的基本用法示例

postgres=# SELECT ceil(3);
 ceil 
------
    3
(1 row)

postgres=# SELECT ceil(3.14);
 ceil 
------
    4
(1 row)

postgres=# SELECT ceil(-3.14);
 ceil 
------
   -3
(1 row)

分类

系统函数

另请参阅

ceiling(), floor()

反馈

在此处 提交关于“ceil()”的任何评论、建议或更正。