HP C/iX Library Reference Manual (30026-90004)
156 Chapter5
HP C/iX Library Function Descriptions
fmod
fmod
Returns the floating-point remainder of
x
divided by
y
.
Syntax
#include <math.h>
double fmod (double
x
, double
y
);
Parameters
x
The numerator.
y
The divisor.
Return Values
f The remainder of
x
/
y
.
NaN Neither
x
or
y
is a number,
x
is +INFINITY,or
y
is zero. In addition, errno
is set to EDOM.
x
An underflow condition has occurred;
y
may be ±infinity.
0 An overflow condition has occurred.
Description
The fmod function returns the floating-point remainder of the division of
x
by
y
. Zero is
returned if
y
is zero or if
x/y
overflows. Otherwise the number f with the same sign as
x
is
returned, such that
x
=i
y
+ f for some integer i and |f|
|y|
.
See Also
floor(), ceil(), fabs(), ANSI C 4.5.6.4, POSIX.1 8.1