The ceil functions - ceil, ceilf, ceill

天井関数 (ceiling function) (引数以上の最小の整数値) を計算します.

ceil

#include <math.h>
double ceil(
    double x
);

ceil 関数は,x 以上の最小の整数値を計算し,結果を double 型で返します.

ceilf (C99)

#include <math.h>
float ceilf(
    float x
);

ceilf 関数は,x 以上の最小の整数値を計算し,結果を float 型で返します.

ceill (C99)

#include <math.h>
long double ceill(
    long double x
);

ceill 関数は,x 以上の最小の整数値を計算し,結果を long double 型で返します.

戻り値

  • x 以上の最小の整数値

数学上の表記

ceil

C言語サンプルプログラム

小数点以下を切り上げるサンプルプログラムをご覧下さい.