]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
2 | .\" | |
3 | .\" Permission is granted to make and distribute verbatim copies of this | |
4 | .\" manual provided the copyright notice and this permission notice are | |
5 | .\" preserved on all copies. | |
6 | .\" | |
7 | .\" Permission is granted to copy and distribute modified versions of this | |
8 | .\" manual under the conditions for verbatim copying, provided that the | |
9 | .\" entire resulting derived work is distributed under the terms of a | |
10 | .\" permission notice identical to this one. | |
c13182ef | 11 | .\" |
fea681da MK |
12 | .\" Since the Linux kernel and libraries are constantly changing, this |
13 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
14 | .\" responsibility for errors or omissions, or for damages resulting from | |
15 | .\" the use of the information contained herein. The author(s) may not | |
16 | .\" have taken the same level of care in the production of this manual, | |
17 | .\" which is licensed free of charge, as they might when working | |
18 | .\" professionally. | |
c13182ef | 19 | .\" |
fea681da MK |
20 | .\" Formatted or processed versions of this manual, if unaccompanied by |
21 | .\" the source, must acknowledge the copyright and authors of this work. | |
22 | .\" | |
23 | .\" References consulted: | |
24 | .\" Linux libc source code | |
25 | .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) | |
26 | .\" 386BSD man pages | |
27 | .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) | |
28 | .\" Modified 2002-07-27 by Walter Harms | |
29 | .\" (walter.harms@informatik.uni-oldenburg.de) | |
30 | .\" | |
a1949252 | 31 | .TH MODF 3 2008-08-05 "" "Linux Programmer's Manual" |
fea681da | 32 | .SH NAME |
c13182ef | 33 | modf, modff, modfl \- extract signed integral and fractional values from |
35478399 | 34 | floating-point number |
fea681da MK |
35 | .SH SYNOPSIS |
36 | .nf | |
37 | .B #include <math.h> | |
38 | .sp | |
39 | .BI "double modf(double " x ", double *" iptr ); | |
d39541ec | 40 | .br |
fea681da | 41 | .BI "float modff(float " x ", float *" iptr ); |
d39541ec | 42 | .br |
fea681da MK |
43 | .BI "long double modfl(long double " x ", long double *" iptr ); |
44 | .fi | |
45 | .sp | |
20c58d70 | 46 | Link with \fI\-lm\fP. |
43595898 MK |
47 | .sp |
48 | .in -4n | |
49 | Feature Test Macro Requirements for glibc (see | |
50 | .BR feature_test_macros (7)): | |
51 | .in | |
52 | .sp | |
53 | .ad l | |
54 | .BR modf (), | |
55 | .BR modl (): | |
56 | _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or | |
57 | .I cc\ -std=c99 | |
58 | .ad b | |
fea681da | 59 | .SH DESCRIPTION |
60a90ecd MK |
60 | The |
61 | .BR modf () | |
62 | function breaks the argument \fIx\fP into an integral | |
fea681da | 63 | part and a fractional part, each of which has the same sign as \fIx\fP. |
43595898 | 64 | The integral part is stored in the location pointed to by \fIiptr\fP. |
fea681da | 65 | .SH "RETURN VALUE" |
60a90ecd MK |
66 | The |
67 | .BR modf () | |
68 | function returns the fractional part of \fIx\fP. | |
43595898 MK |
69 | |
70 | If | |
71 | .I x | |
72 | is a NaN, a NaN is returned, and | |
73 | .IR *iptr | |
74 | is set to a NaN. | |
75 | ||
76 | If | |
77 | .I x | |
78 | is positive infinity (negative infinity), +0 (-0) is returned, and | |
79 | .IR *iptr | |
80 | is set to positive infinity (negative infinity). | |
81 | .SH ERRORS | |
82 | No errors occur. | |
fea681da | 83 | .SH "CONFORMING TO" |
43595898 MK |
84 | C99, POSIX.1-2001. |
85 | The variant returning | |
86 | .I double | |
87 | also conforms to | |
68e1685c | 88 | SVr4, 4.3BSD, C89. |
fea681da MK |
89 | .SH "SEE ALSO" |
90 | .BR frexp (3), | |
91 | .BR ldexp (3) |