1MODF(3) Linux Programmer's Manual MODF(3)
2
3
4
6 modf, modff, modfl - extract signed integral and fractional values from
7 floating-point number
8
10 #include <math.h>
11
12 double modf(double x, double *iptr);
13 float modff(float x, float *iptr);
14 long double modfl(long double x, long double *iptr);
15
16 Link with -lm.
17
18 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20 modf(), modl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 ||
21 _ISOC99_SOURCE; or cc -std=c99
22
24 The modf() function breaks the argument x into an integral part and a
25 fractional part, each of which has the same sign as x. The integral
26 part is stored in the location pointed to by iptr.
27
29 The modf() function returns the fractional part of x.
30
31 If x is a NaN, a NaN is returned, and *iptr is set to a NaN.
32
33 If x is positive infinity (negative infinity), +0 (-0) is returned, and
34 *iptr is set to positive infinity (negative infinity).
35
37 No errors occur.
38
40 C99, POSIX.1-2001. The variant returning double also conforms to SVr4,
41 4.3BSD, C89.
42
44 frexp(3), ldexp(3)
45
47 This page is part of release 3.22 of the Linux man-pages project. A
48 description of the project, and information about reporting bugs, can
49 be found at http://www.kernel.org/doc/man-pages/.
50
51
52
53 2008-08-05 MODF(3)