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       modff(), modfl():
21           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
22               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
23               || /* Glibc <= 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 at‐
43       tributes(7).
44
45       ┌────────────────────────────────────────────┬───────────────┬─────────┐
46Interface                                   Attribute     Value   
47       ├────────────────────────────────────────────┼───────────────┼─────────┤
48modf(), modff(), modfl()                    │ Thread safety │ MT-Safe │
49       └────────────────────────────────────────────┴───────────────┴─────────┘
50

CONFORMING TO

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

SEE ALSO

57       frexp(3), ldexp(3)
58

COLOPHON

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