C90 | double ceil (double x); |
C99 | double ceil (double x);
float ceilf (float x); long double ceill (long double x); |
C++98 | double ceil (double x);
float ceil (float x); long double ceil (long double x); |
C++11 | double ceil (double x);
float ceil (float x); long double ceil (long double x); double ceil (T x); // additional overloads for integral types |
C99 | 头文件<tgmath.h> 提供了该函数的类型泛型宏版本。 |
C++11 | 这个头文件(<cmath>) 为整型提供了额外的重载:这些重载在计算之前将x转换为double
(在T是任何整型时定义)。
|
/* ceil example */ #include <stdio.h> /* printf */ #include <math.h> /* ceil */ int main () { printf ( "ceil of 2.3 is %.1f\n", ceil(2.3) ); printf ( "ceil of 3.8 is %.1f\n", ceil(3.8) ); printf ( "ceil of -2.3 is %.1f\n", ceil(-2.3) ); printf ( "ceil of -3.8 is %.1f\n", ceil(-3.8) ); return 0; } |
fabs | 绝对值(function ) |
floor | 向下舍入(function ) |
modf | 分成小数部分和整数部分 (function ) |