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(), modfl():
21 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 ||
22 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
23 or cc -std=c99
24
26 The modf() function breaks the argument x into an integral part and a
27 fractional part, each of which has the same sign as x. The integral
28 part is stored in the location pointed to by iptr.
29
31 The modf() function returns the fractional part of x.
32
33 If x is a NaN, a NaN is returned, and *iptr is set to a NaN.
34
35 If x is positive infinity (negative infinity), +0 (-0) is returned, and
36 *iptr is set to positive infinity (negative infinity).
37
39 No errors occur.
40
42 Multithreading (see pthreads(7))
43 The modf(), modff(), and modfl() functions are thread-safe.
44
46 C99, POSIX.1-2001. The variant returning double also conforms to SVr4,
47 4.3BSD, C89.
48
50 frexp(3), ldexp(3)
51
53 This page is part of release 3.53 of the Linux man-pages project. A
54 description of the project, and information about reporting bugs, can
55 be found at http://www.kernel.org/doc/man-pages/.
56
57
58
59 2013-06-21 MODF(3)