Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-15
ceil
2. This example allocates memory for a structure of 20 elements that are each the size
of the structure name:
#include <stdlibh>
int main(void)
{
struct name
{
char *last;
char *first;
} *s_ptr;
s_ptr = (struct name *)calloc(20, sizeof(struct name));
}
ceil
The ceil function returns the smallest integer not less than the value of its argument.
expr
is an expression of type double.
Return Value
is the smallest integer not less than expr, expressed as a double value.
Example
This example prints “The ceiling value of 1.090000 is 2.000000.”
#include <mathh>
#include <stdioh>
int main(void)
{
double x, r;
x = 1.09;
r = ceil(x);
printf("The ceiling value of %f is %f.", x, r);
}
#include <mathh>
double ceil(double expr);