HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)
m
modf(3M) modf(3M)
NAME
modf( ) - decompose 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.
To use this function, make sure your program includes <
math.h>, and link in the math library by specify-
ing
-lm on the compiler or linker command line.
RETURN VALUE
Upon successful completion, the modf() function returns the signed fractional part of x.
If x is NaN,
modf() returns NaN.
If the correct value after rounding would be smaller in magnitude than MINDOUBLE, modf() returns
zero.
ERRORS
No errors are defined.
SEE ALSO
frexp(3M), ldexp(3M), scalb(3M), scalbn(3M), math(5), values(5).
STANDARDS CONFORMANCE
modf(): SVID3, XPG4.2, ANSI C
Section 3−−560 Hewlett-Packard Company − 1 − HP-UX 11i Version 1: September 2005