1modf(3)                    Library Functions Manual                    modf(3)
2
3
4

NAME

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

LIBRARY

10       Math library (libm, -lm)
11

SYNOPSIS

13       #include <math.h>
14
15       double modf(double x, double *iptr);
16       float modff(float x, float *iptr);
17       long double modfl(long double x, long double *iptr);
18
19   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
20
21       modff(), modfl():
22           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
23               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
24               || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
25

DESCRIPTION

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

RETURN VALUE

32       These functions return the fractional part of x.
33
34       If x is a NaN, a NaN is returned, and *iptr is set to a NaN.
35
36       If x is positive infinity (negative infinity), +0 (-0) is returned, and
37       *iptr is set to positive infinity (negative infinity).
38

ERRORS

40       No errors occur.
41

ATTRIBUTES

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

STANDARDS

53       C11, POSIX.1-2008.
54

HISTORY

56       C99, POSIX.1-2001.
57
58       The variant returning double also conforms to SVr4, 4.3BSD, C89.
59

SEE ALSO

61       frexp(3), ldexp(3)
62
63
64
65Linux man-pages 6.05              2023-07-20                           modf(3)
Impressum