1MODF(3)                    Linux Programmer's Manual                   MODF(3)
2
3
4

NAME

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

SYNOPSIS

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           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
22               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
23               || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
24

DESCRIPTION

26       These functions break the argument x into an integral part and a  frac‐
27       tional  part,  each of which has the same sign as x.  The integral part
28       is stored in the location pointed to by iptr.
29

RETURN VALUE

31       These functions return 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

ERRORS

39       No errors occur.
40

ATTRIBUTES

42       For   an   explanation   of   the  terms  used  in  this  section,  see
43       attributes(7).
44
45       ┌─────────────────────────┬───────────────┬─────────┐
46Interface                Attribute     Value   
47       ├─────────────────────────┼───────────────┼─────────┤
48modf(), modff(), modfl() │ Thread safety │ MT-Safe │
49       └─────────────────────────┴───────────────┴─────────┘

CONFORMING TO

51       C99, POSIX.1-2001, POSIX.1-2008.
52
53       The variant returning double also conforms to SVr4, 4.3BSD, C89.
54

SEE ALSO

56       frexp(3), ldexp(3)
57

COLOPHON

59       This page is part of release 5.02 of the Linux  man-pages  project.   A
60       description  of  the project, information about reporting bugs, and the
61       latest    version    of    this    page,    can     be     found     at
62       https://www.kernel.org/doc/man-pages/.
63
64
65
66                                  2017-09-15                           MODF(3)
Impressum