HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)
c
ceil(3M) ceil(3M)
NAME
ceil() - ceiling function
SYNOPSIS
#include <math.h>
double ceil(double x);
DESCRIPTION
ceil() returns the smallest integer (represented as a double-precision number) not less than x.
To use this function, make sure your program includes <
math.h>, and link in the math library by specify-
ing
-lm on the compiler or linker command line.
RETURN VALUE
If x is ±INFINITY or ±zero,
ceil() returns x.
If x is NaN,
ceil() returns NaN.
If the correct value would overflow, ceil() returns HUGE_VAL and sets errno to [ERANGE]. (This
description complies with XPG4.2; however, the
ceil() function never overflows on HP-UX systems.)
ERRORS
If ceil() fails, errno is set to the following value.
[ERANGE] The correct value would overflow.
SEE ALSO
fabs(3M), floor(3M), fmod(3M), rint(3M), math(5).
STANDARDS CONFORMANCE
ceil(): SVID3, XPG4.2, ANSI C
HP-UX 11i Version 1: September 2005 − 1 − Hewlett-Packard Company Section 3−−65