]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/fabs.3
encrypt.3: srcfix: rewrap source lines
[thirdparty/man-pages.git] / man3 / fabs.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\" Linux libc source code
27 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\" 386BSD man pages
29 .\" Modified Sat Jul 24 19:42:04 1993 by Rik Faith (faith@cs.unc.edu)
30 .\" Added fabsl, fabsf, aeb, 2001-06-07
31 .\"
32 .TH FABS 3 2017-09-15 "" "Linux Programmer's Manual"
33 .SH NAME
34 fabs, fabsf, fabsl \- absolute value of floating-point number
35 .SH SYNOPSIS
36 .nf
37 .B #include <math.h>
38 .PP
39 .BI "double fabs(double " x );
40 .BI "float fabsf(float " x );
41 .BI "long double fabsl(long double " x );
42 .fi
43 .PP
44 Link with \fI\-lm\fP.
45 .PP
46 .in -4n
47 Feature Test Macro Requirements for glibc (see
48 .BR feature_test_macros (7)):
49 .in
50 .PP
51 .ad l
52 .BR fabsf (),
53 .BR fabsl ():
54 .RS 4
55 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
56 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
57 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
58 .RE
59 .ad b
60 .SH DESCRIPTION
61 These functions return the absolute value of the floating-point
62 number
63 .IR x .
64 .SH RETURN VALUE
65 These functions return the absolute value of
66 .IR x .
67 .PP
68 If
69 .I x
70 is a NaN, a NaN is returned.
71 .PP
72 If
73 .I x
74 is \-0, +0 is returned.
75 .PP
76 If
77 .I x
78 is negative infinity or positive infinity, positive infinity is returned.
79 .SH ERRORS
80 No errors occur.
81 .SH ATTRIBUTES
82 For an explanation of the terms used in this section, see
83 .BR attributes (7).
84 .TS
85 allbox;
86 lbw24 lb lb
87 l l l.
88 Interface Attribute Value
89 T{
90 .BR fabs (),
91 .BR fabsf (),
92 .BR fabsl ()
93 T} Thread safety MT-Safe
94 .TE
95 .SH CONFORMING TO
96 C99, POSIX.1-2001, POSIX.1-2008.
97 .PP
98 The variant returning
99 .I double
100 also conforms to
101 SVr4, 4.3BSD, C89.
102 .SH SEE ALSO
103 .BR abs (3),
104 .BR cabs (3),
105 .BR ceil (3),
106 .BR floor (3),
107 .BR labs (3),
108 .BR rint (3)