Computes the floating-point remainder value.
#include <math.h> float fmodf (x, y) float x; float y; long double fmodl (x) long double x, y; double fmod (x, y) double x, y;
The fmodf, fmodl, and fmod subroutines return the floating-point remainder of the division of x by y.
An application wishing to check for error situations should set the errno global variable to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these subroutines. Upon return, if errno is nonzero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is nonzero, an error has occurred.
x | Specifies the value to be computed. |
y | Specifies the value to be computed. |
The fmodf, fmodl, and fmod subroutines return the value x- i *y, for some integer i such that, if y is nonzero, the result has the same sign as x and magnitude less than the magnitude of y.
If the correct value would cause underflow, and is not representable, a range error may occur, and 0.0 is returned.
If x or y is NaN, a NaN is returned.
If y is zero, a domain error occurs, and a NaN is returned.
If x is infinite, a domain error occurs, and a NaN is returned.
If x is ±0 and y is not zero, ±0 is returned.
If x is not infinite and y is ±Inf, x is returned.
If the correct value would cause underflow, and is representable, a range error may occur and the correct value is returned.
feclearexcept Subroutine, fetestexcept Subroutine, and class, _class, finite, isnan, or unordered Subroutines.
math.h in AIX 5L Version 5.2 Files Reference.