]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/modf.3
update timestamp
[thirdparty/man-pages.git] / man3 / modf.3
CommitLineData
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 33modf, modff, modfl \- extract signed integral and fractional values from
35478399 34floating-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 46Link with \fI\-lm\fP.
43595898
MK
47.sp
48.in -4n
49Feature 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
60The
61.BR modf ()
62function breaks the argument \fIx\fP into an integral
fea681da 63part and a fractional part, each of which has the same sign as \fIx\fP.
43595898 64The integral part is stored in the location pointed to by \fIiptr\fP.
fea681da 65.SH "RETURN VALUE"
60a90ecd
MK
66The
67.BR modf ()
68function returns the fractional part of \fIx\fP.
43595898
MK
69
70If
71.I x
72is a NaN, a NaN is returned, and
73.IR *iptr
74is set to a NaN.
75
76If
77.I x
78is positive infinity (negative infinity), +0 (-0) is returned, and
79.IR *iptr
80is set to positive infinity (negative infinity).
81.SH ERRORS
82No errors occur.
fea681da 83.SH "CONFORMING TO"
43595898
MK
84C99, POSIX.1-2001.
85The variant returning
86.I double
87also conforms to
68e1685c 88SVr4, 4.3BSD, C89.
fea681da
MK
89.SH "SEE ALSO"
90.BR frexp (3),
91.BR ldexp (3)