fmod function — Computes modulus
float fmod(float x, float y) double fmod(double x, double y) long double fmod(long double x, long double y)
The fmod
function returns
the floating-point remainder of dividing x
by y
.
If y
is 0
, the behavior is implementation-defined:
the return value might be 0
, or a
domain error can occur. If y
is
nonzero, the return value is x
-
k
× y
for some integer k
, such that the result has the same sign
as x
and an absolute value less
than the absolute value of y
.