OSDN Git Service

ee72384ba47d9aa99508ef447142abde56639844
[linuxjm/LDP_man-pages.git] / original / man3 / modf.3
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.
11 .\"
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.
19 .\"
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 .\"
31 .TH MODF 3  2010-09-20 ""  "Linux Programmer's Manual"
32 .SH NAME
33 modf, modff, modfl \- extract signed integral and fractional values from
34 floating-point number
35 .SH SYNOPSIS
36 .nf
37 .B #include <math.h>
38 .sp
39 .BI "double modf(double " x ", double *" iptr );
40 .br
41 .BI "float modff(float " x ", float *" iptr );
42 .br
43 .BI "long double modfl(long double " x ", long double *" iptr );
44 .fi
45 .sp
46 Link with \fI\-lm\fP.
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 modfl ():
56 .RS 4
57 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
58 _POSIX_C_SOURCE\ >=\ 200112L;
59 .br
60 or
61 .I cc\ -std=c99
62 .RE
63 .ad
64 .SH DESCRIPTION
65 The
66 .BR modf ()
67 function breaks the argument \fIx\fP into an integral
68 part and a fractional part, each of which has the same sign as \fIx\fP.
69 The integral part is stored in the location pointed to by \fIiptr\fP.
70 .SH "RETURN VALUE"
71 The
72 .BR modf ()
73 function returns the fractional part of \fIx\fP.
74
75 If
76 .I x
77 is a NaN, a NaN is returned, and
78 .IR *iptr
79 is set to a NaN.
80
81 If
82 .I x
83 is positive infinity (negative infinity), +0 (-0) is returned, and
84 .IR *iptr
85 is set to positive infinity (negative infinity).
86 .SH ERRORS
87 No errors occur.
88 .SH "CONFORMING TO"
89 C99, POSIX.1-2001.
90 The variant returning
91 .I double
92 also conforms to
93 SVr4, 4.3BSD, C89.
94 .SH "SEE ALSO"
95 .BR frexp (3),
96 .BR ldexp (3)