floor()

NAME

floor(), floorf() - largest integral value not greater than x

SYNOPSIS

#include <math.h>

double floor (double x) float floor (float x)

DESCRIPTION

The floor(3) and floorf(3) functions compute the largest integral value not greater than x.

RETURN VALUES

The floor(3) and floorf(3) functions return the largest integral value expressed as a double.

If the result would cause an overflow, floor(3) returns -HUGE_VAL and sets errno. If x is +-If f or +-0, floor(3) returns the value of x.

ERRORS

The floor(3) function can fail for the following reasons:

[EDOM]
The argument x is NaN.
[ERANGE]
The result would cause an overflow.

SEE ALSO

abs(3)

ceil(3)

fabs(3)

ieee(3)

math(3)

rint(3)