HP-UX Reference (11i v2 03/08) - 3 Library Functions A-M (vol 6)

c
ceil(3M) ceil(3M)
NAME
ceil( ), ceilf( ), ceill( ), ceilw( ), ceilq( ) - ceiling functions
SYNOPSIS
#include <math.h>
double ceil(double x);
Itanium(R)-based System Only
float ceilf(float x);
long double ceill(long double x);
extended ceilw(extended x);
quad ceilq(quad x);
DESCRIPTION
The ceil() returns the smallest integer (represented as a double-precision number) not less than x.
Itanium-based System Only
ceilf() is a float version of ceil(); it takes a
float argument and returns a float result.
ceill() is a long double version of ceil(); it takes a long double argument and returns a
long double result.
ceilw() is an extended version of ceil(); it takes an extended argument and returns an
extended result.
ceilq() is equivalent to ceill() on HP-UX systems.
USAGE
To use (for Itanium-based systems)
ceilf(), compile either with the default -Ae option or with the -Aa
option.
To use (for Itanium-based systems)
ceill(), ceilw(),orceilq(), compile either with the default
-Ae option or with the -Aa and -D_HPUX_SOURCE
options.
To use (for Itanium-based systems)
ceilw() or ceilq(), compile also with the -fpwidetypes
option.
To use these functions, make sure your program includes
<math.h>. Link in the math library by speci-
fying -lm on the compiler or linker command line.
For more information, see the HP-UX Floating-Point Guide.
RETURN VALUE
If x is ±INFINITY or ±zero, ceil() returns x.
If x is NaN,
ceil() returns NaN.
ceil() may raise the inexact exception if x is non integral and finite.
ERRORS
No errors are defined.
SEE ALSO
fabs(3M), floor(3M), fmod(3M), rint(3M), math(5).
STANDARDS CONFORMANCE
ceil() : SVID3, XPG4.2, ANSI C, ISO/IEC C99 (including Annex F, ‘‘IEC 60559 floating-point arith-
metic’’)
ceilf(), ceill() : ISO/IEC C99 (including Annex F, ‘‘IEC 60559 floating-point arithmetic’’)
Section 388 Hewlett-Packard Company 1 HP-UX 11i Version 2: August 2003