5.7. Nearest Integer, Absolute Value and Remainder Functions

5.7.1. The ceil function

Synopsis
#include <math.h>

double ceil (double x );

Description

The ceil function computes the smallest integral value not less than x.

Returns

The ceil function returns the smallest integral value not less than x, expressed as a double.

See Also

Section 5.7.3

Implementation Notes

None.

5.7.2. The fabs function

Synopsis
#include <math.h>

double fabs (double x );

Description

The fabs function computes the absolute value of a floating-point number x.

Returns

The fabs function returns the absolute value of x.

Implementation Notes

5.7.3. The floor function

Synopsis
#include <math.h>

double floor (double x );

Description

The floor function computes the largest integral value not greater than x.

Returns

The floor function returns the largest integral value not greater than x, expressed as a double.

See Also

Section 5.7.1

Implementation Notes

None.

5.7.4. The fmod function

Synopsis
#include <math.h>

double fmod (double x , double y );

Description

The fmod function computes the floating point remainder of x/y.

Returns

The fmod function returns the value x-i*y for some integer i such that, if y is nonzero, the result has the same sign as x and a magnitude less than the magnitude of y. If y is zero, whether a domain error occurs or the fmod function returns zero is implementation-defined.

Implementation Notes