|
|
coherent
ceil() Mathematics Function ceil()
Set numeric ceiling
#include <math.h>
ddoouubbllee cceeiill(_z) ddoouubbllee _z;
ceil returns a double-precision floating point number whose value
is the smallest integer greater than or equal to z.
***** Example *****
The following example demonstrates how to use ceil:
#include <math.h>
#include <stdio.h>
#define display(x) dodisplay((double)(x), #x)
dodisplay(value, name)
double value; char *name;
{
if (errno)
perror(name);
else
printf("%10g %s\n", value, name);
errno = 0;
}
main()
{
extern char *gets();
double x;
char string[64];
for (;;) {
printf("Enter number: ");
if (gets(string) == NULL)
break;
x = atof(string);
display(x);
display(ceil(x));
display(floor(x));
display(fabs(x));
display(sqrt(x));
}
putchar('\n');
COHERENT Lexicon Page 1
ceil() Mathematics Function ceil()
}
***** See Also *****
abs(), fabs(), floor(), frexp(), mathematics library
COHERENT Lexicon Page 2
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.