HP-UX Reference (11i v2 04/09) - 3 Library Functions A-M (vol 6)
f
floor(3M) floor(3M)
NAME
floor( ), floorf( ), floorl( ), floorw( ), floorq( ) - floor functions
SYNOPSIS
#include <math.h>
double floor(double x);
Itanium(R)-based System Only
float floorf(float x);
long double floorl(long double x);
extended floorw(extended x);
quad floorq(quad x);
DESCRIPTION
The floor() returns the largest integer (represented as a double-precision number) not greater than x.
Itanium-based System Only
floorf() is a float version of floor(); it takes a
float argument and returns a float result.
floorl() is a long double version of floor(); it takes a long double argument and returns a
long double result.
floorw() is an extended version of floor(); it takes an extended argument and returns an
extended result.
floorq() is equivalent to floorl() on HP-UX systems.
USAGE
To use (for Itanium-based systems)
floorf(), compile either with the default -Ae option or with the
-Aa option.
To use (for Itanium-based systems)
floorl(), floorw(),orfloorq(), compile either with the
default
-Ae option or with the -Aa and -D_HPUX_SOURCE
options.
To use (for Itanium-based systems)
floorw() or floorq(), 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, floor() returns x.
If x is NaN,
floor() returns NaN.
floor() may raise the inexact exception if x is non integral and finite.
ERRORS
No errors are defined.
SEE ALSO
ceil(3M), fabs(3M), fmod(3M), rint(3M), math(5).
STANDARDS CONFORMANCE
floor() : SVID3, XPG4.2, ANSI C, ISO/IEC C99 (including Annex F, ‘‘IEC 60559 floating-point arith-
metic’’)
floorf(), floorl() : ISO/IEC C99 (including Annex F, ‘‘IEC 60559 floating-point arithmetic’’)
HP-UX 11i Version 2: September 2004 − 1 − Hewlett-Packard Company Section 3−−325