NAME
modf — decompose a
floating-point number
SYNOPSIS
#include <math.h> double modf(double x, double *iptr);
DESCRIPTION
The modf() function breaks the argument x into integral and fractional parts, each of which has the same sign as the argument. It stores the integral part as a double in the object pointed to by iptr .
An application wishing to check for error situations should set errno to 0 before calling modf(). If errno is non-zero on return, or the return value is NaN, an error has occurred.
RETURN VALUE
Upon successful completion, modf() returns the signed fractional part of x.
If x is NaN, NaN is returned, errno may be set to [EDOM] and *iptr is set to NaN.
If the correct value would cause underflow, 0 is returned and errno may be set to [ERANGE].
ERRORS
The modf() function may fail if:
No other errors will occur.
EXAMPLES
None.
APPLICATION USAGE
None.
SEE ALSO
DERIVATION
Derived from Issue 1 of the SVID.