ceil, ceilf, ceill - ceiling function: smallest integral value not less than argument
#include <math.h>
double ceil(double x);
float ceilf(float x);
long double ceill(long double x);
Link with -lm
.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
These functions return the smallest integral value that is not less than x
.
For example, ceil(0.5)
is 1.0, and ceil(-0.5)
is 0.0.
These functions return the ceiling of x
.
If x
is integral, +0, -0, NaN, or infinite, x
itself is returned.