]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/modf.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / man3 / modf.3
1 '\" t
2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9 .\" 386BSD man pages
10 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
11 .\" Modified 2002-07-27 by Walter Harms
12 .\" (walter.harms@informatik.uni-oldenburg.de)
13 .\"
14 .TH modf 3 (date) "Linux man-pages (unreleased)"
15 .SH NAME
16 modf, modff, modfl \- extract signed integral and fractional values from
17 floating-point number
18 .SH LIBRARY
19 Math library
20 .RI ( libm ", " \-lm )
21 .SH SYNOPSIS
22 .nf
23 .B #include <math.h>
24 .PP
25 .BI "double modf(double " x ", double *" iptr );
26 .BI "float modff(float " x ", float *" iptr );
27 .BI "long double modfl(long double " x ", long double *" iptr );
28 .fi
29 .PP
30 .RS -4
31 Feature Test Macro Requirements for glibc (see
32 .BR feature_test_macros (7)):
33 .RE
34 .PP
35 .BR modff (),
36 .BR modfl ():
37 .nf
38 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
39 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
40 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
41 .fi
42 .SH DESCRIPTION
43 These functions break the argument
44 .I x
45 into an integral
46 part and a fractional part, each of which has the same sign as
47 .IR x .
48 The integral part is stored in the location pointed to by
49 .IR iptr .
50 .SH RETURN VALUE
51 These functions return the fractional part of
52 .IR x .
53 .PP
54 If
55 .I x
56 is a NaN, a NaN is returned, and
57 .I *iptr
58 is set to a NaN.
59 .PP
60 If
61 .I x
62 is positive infinity (negative infinity), +0 (\-0) is returned, and
63 .I *iptr
64 is set to positive infinity (negative infinity).
65 .SH ERRORS
66 No errors occur.
67 .SH ATTRIBUTES
68 For an explanation of the terms used in this section, see
69 .BR attributes (7).
70 .TS
71 allbox;
72 lbx lb lb
73 l l l.
74 Interface Attribute Value
75 T{
76 .na
77 .nh
78 .BR modf (),
79 .BR modff (),
80 .BR modfl ()
81 T} Thread safety MT-Safe
82 .TE
83 .sp 1
84 .SH STANDARDS
85 C11, POSIX.1-2008.
86 .SH HISTORY
87 C99, POSIX.1-2001.
88 .PP
89 The variant returning
90 .I double
91 also conforms to
92 SVr4, 4.3BSD, C89.
93 .SH SEE ALSO
94 .BR frexp (3),
95 .BR ldexp (3)