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