FLOOR(3M)
NAME
floor, ceil, fmod, fabs − floor, ceiling, remainder, absolute value functions
SYNOPSIS
#include <math.h>
double floor (x)
double x;
double ceil (x)
double x;
double fmod (x, y)
double x, y;
double fabs (x)
double x;
DESCRIPTION
Floor returns the largest integer (as a double-precision number) not greater than x.
Ceil returns the smallest integer not less than x.
Fmod returns the floating-point remainder (f) of the division of x by y, where f has the same sign as x, such that x = iy + f for some integer i, and |f| < |y|.
Fabs returns the absolute value of x, |x|.
DEPENDENCIES
Series 300
Fmod returns x if y is 0.0 or if x/y would overflow.
Series 800 (/lib/libm.a)
When x is ±INFINITY , floor and ceil return ±INFINITY respectively.
Fabs returns +INFINITY when x is ±INFINITY .
Fmod returns x if y is 0.0, if x/y would overflow, or if x/y would underflow (including when y is ±INFINITY ).
Series 800 (ANSI C /lib/LibM.a)
When x is ±INFINITY , floor and ceil return ±INFINITY respectively.
Fabs returns +INFINITY when x is ±INFINITY .
Fmod returns 0.0 if x/y would overflow, or x if x/y would underflow (including when y is ±INFINITY ).
ERRORS
Series 800 (/lib/libm.a)
Floor and ceil return NaN and set errno to EDOM when x is NaN.
Fmod returns NaN and sets errno to EDOM when x or y is NaN, or when x is ±INFINITY .
Fabs returns NaN and sets errno to EDOM when x is NaN.
Series 800 (ANSI C /lib/libM.a)
Floor and ceil return NaN and set errno to EDOM when x is NaN.
Fmod returns NaN and sets errno to EDOM when y is 0.0, when x or y is NaN, or when x is ±INFINITY .
Fabs returns NaN and sets errno to EDOM when x is NaN.
SEE ALSO
abs(3C), isinf(3M), isnan(3M).
STANDARDS CONFORMANCE
floor: SVID2, XPG2, XPG3, POSIX.1, FIPS 151-1, ANSI C
ceil: SVID2, XPG2, XPG3, POSIX.1, FIPS 151-1, ANSI C
fabs: SVID2, XPG2, XPG3, POSIX.1, FIPS 151-1, ANSI C
fmod: SVID2, XPG2, XPG3, POSIX.1, FIPS 151-1, ANSI C
Hewlett-Packard Company — HP-UX Release 7.0: Sept 1989