Copyright © 1997 The Open Group

modf - decompose a floating-point number

`#include <math.h> double modf(double`

x, double *iptr);

Themodf()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 byiptr.An application wishing to check for error situations should set

errnoto 0 before callingmodf(). Iferrnois non-zero on return, or the return value is NaN, an error has occurred.

Upon successful completion,modf()returns the signed fractional part ofx.If

xis NaN, NaN is returned,errnomay be set to [EDOM] and*iptris set to NaN.If the correct value would cause underflow, 0 is returned and

errnomay be set to [ERANGE].

Themodf()function may fail if:

- [EDOM]
- The value of
xis NaN.- [ERANGE]
- The result underflows.
No other errors will occur.

None.

None.

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

Derived from Issue 1 of the SVID.

Copyright © 1997 The Open Group

[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]