MODF(3) Library Functions Manual MODF(3)

modfdecompose a floating-point number

#include <math.h>

double modf(double x, double *iptr);

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 . If errno is non-zero on return, or the return value is NaN, an error has occurred.

Upon successful completion, modf() returns the signed fractional part of x.

If is NaN, NaN is returned, errno may be set to [EDOM] and is set to NaN.

If the correct value would cause underflow, 0 is returned and errno may be set to [ERANGE].

The modf() function may fail if:

The value of x is NaN.
The result underflows.

No other errors will occur.

None.

None.

frexp(3) , isnan(3) , ldexp(3) , <math.h> .

Derived from Issue 1 of the SVID.

February 1997 posix.fail