Man Linux: Main Page and Category List

modf, modff, modfl - extract signed integral and fractional values from floating-point number

#include<math.h>doublemodf(doublex,double*iptr);floatmodff(floatx,float*iptr);longdoublemodfl(longdoublex,longdouble*iptr);Link with-lm. Feature Test Macro Requirements for glibc (seefeature_test_macros(7)):modf(),modl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; orcc-std=c99

Themodf() function breaks the argumentxinto an integral part and a fractional part, each of which has the same sign asx. The integral part is stored in the location pointed to byiptr.

Themodf() function returns the fractional part ofx. Ifxis a NaN, a NaN is returned, and*iptris set to a NaN. Ifxis positive infinity (negative infinity), +0 (-0) is returned, and*iptris set to positive infinity (negative infinity).

No errors occur.

C99, POSIX.1-2001. The variant returningdoublealso conforms to SVr4, 4.3BSD, C89.

frexp(3),ldexp(3)

This page is part of release 3.24 of the Linuxman-pagesproject. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-05