1MODF(3P) POSIX Programmer's Manual MODF(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 modf, modff, modfl - decompose a floating-point number
13
15 #include <math.h>
16
17 double modf(double x, double *iptr);
18 float modff(float value, float *iptr);
19 long double modfl(long double value, long double *iptr);
20
21
23 These functions shall break the argument x into integral and fractional
24 parts, each of which has the same sign as the argument. It stores the
25 integral part as a double (for the modf() function), a float (for the
26 modff() function), or a long double (for the modfl() function), in the
27 object pointed to by iptr.
28
30 Upon successful completion, these functions shall return the signed
31 fractional part of x.
32
33 If x is NaN, a NaN shall be returned, and *iptr shall be set to a NaN.
34
35 If x is ±Inf, ±0 shall be returned, and *iptr shall be set to ±Inf.
36
38 No errors are defined.
39
40 The following sections are informative.
41
43 None.
44
46 The modf() function computes the function result and *iptr such that:
47
48
49 a = modf(x, iptr) ;
50 x == a+*iptr ;
51
52 allowing for the usual floating-point inaccuracies.
53
55 None.
56
58 None.
59
61 frexp(), isnan(), ldexp(), the Base Definitions volume of
62 IEEE Std 1003.1-2001, <math.h>
63
65 Portions of this text are reprinted and reproduced in electronic form
66 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
67 -- Portable Operating System Interface (POSIX), The Open Group Base
68 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
69 Electrical and Electronics Engineers, Inc and The Open Group. In the
70 event of any discrepancy between this version and the original IEEE and
71 The Open Group Standard, the original IEEE and The Open Group Standard
72 is the referee document. The original Standard can be obtained online
73 at http://www.opengroup.org/unix/online.html .
74
75
76
77IEEE/The Open Group 2003 MODF(3P)