HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)
f
floor(3M) floor(3M)
NAME
floor() - floor function
SYNOPSIS
#include <math.h>
double floor(double x);
DESCRIPTION
floor() returns the largest integer (represented as a double-precision number) not greater 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,
floor() returns x.
If x is NaN,
floor() returns NaN.
If the correct value would overflow, floor() returns −HUGE_VAL and sets errno to [ERANGE]. (This
description complies with XPG4.2; however, the
floor() function never overflows on HP-UX systems.)
ERRORS
If floor() fails, errno is set to the following value.
[ERANGE] The correct value would overflow.
SEE ALSO
ceil(3M), fabs(3M), fmod(3M), rint(3M), math(5).
STANDARDS CONFORMANCE
floor(): SVID3, XPG4.2, ANSI C
Section 3−−268 Hewlett-Packard Company − 1 − HP-UX 11i Version 1: September 2005