機能 |
x以上の最小の整数値(切上げ値)を計算することを表す。 |
||
---|---|---|---|
定義 |
#include <math.h> double ceil ( double x ); float ceil ( float x ); long double ceil ( long double x ); ※C99規格では以下の定義となる double ceil ( double x ); float ceilf ( float x ); long double ceill ( long double x ); |
||
引数 |
|
||
戻り値 | 計算結果を返す。 | ||
実装例 |
#include <math.h> #include <stdio.h> int main(void) { double a = 1.5; printf("ceil(%f) = %f\n", a, ceil(a) ); return 0; } |
||
実行結果 |
ceil(1.500000) = 2.000000 |
ceil()