]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
2 | .\" | |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
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. | |
c13182ef | 12 | .\" |
fea681da MK |
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. | |
c13182ef | 20 | .\" |
fea681da MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
fea681da MK |
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 | .\" | |
4b8c67d9 | 32 | .TH FABS 3 2017-09-15 "" "Linux Programmer's Manual" |
fea681da MK |
33 | .SH NAME |
34 | fabs, fabsf, fabsl \- absolute value of floating-point number | |
35 | .SH SYNOPSIS | |
36 | .nf | |
37 | .B #include <math.h> | |
68e4db0a | 38 | .PP |
fea681da | 39 | .BI "double fabs(double " x ); |
fea681da | 40 | .BI "float fabsf(float " x ); |
fea681da MK |
41 | .BI "long double fabsl(long double " x ); |
42 | .fi | |
68e4db0a | 43 | .PP |
20c58d70 | 44 | Link with \fI\-lm\fP. |
68e4db0a | 45 | .PP |
824eec7e MK |
46 | .in -4n |
47 | Feature Test Macro Requirements for glibc (see | |
48 | .BR feature_test_macros (7)): | |
49 | .in | |
68e4db0a | 50 | .PP |
824eec7e MK |
51 | .ad l |
52 | .BR fabsf (), | |
53 | .BR fabsl (): | |
2c3ae4cd | 54 | .RS 4 |
e9d91bcf MK |
55 | _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L |
56 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE | |
57 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
2c3ae4cd | 58 | .RE |
824eec7e | 59 | .ad b |
fea681da | 60 | .SH DESCRIPTION |
0d9df44e | 61 | These functions return the absolute value of the floating-point |
022671eb MK |
62 | number |
63 | .IR x . | |
824eec7e MK |
64 | .SH RETURN VALUE |
65 | These functions return the absolute value of | |
66 | .IR x . | |
847e0d88 | 67 | .PP |
824eec7e MK |
68 | If |
69 | .I x | |
70 | is a NaN, a NaN is returned. | |
847e0d88 | 71 | .PP |
824eec7e MK |
72 | If |
73 | .I x | |
74 | is \-0, +0 is returned. | |
847e0d88 | 75 | .PP |
824eec7e MK |
76 | If |
77 | .I x | |
78 | is negative infinity or positive infinity, positive infinity is returned. | |
fea681da | 79 | .SH ERRORS |
824eec7e | 80 | No errors occur. |
594e3173 | 81 | .SH ATTRIBUTES |
6904b640 MK |
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{ | |
594e3173 PH |
90 | .BR fabs (), |
91 | .BR fabsf (), | |
594e3173 | 92 | .BR fabsl () |
6904b640 MK |
93 | T} Thread safety MT-Safe |
94 | .TE | |
47297adb | 95 | .SH CONFORMING TO |
9a74e018 | 96 | C99, POSIX.1-2001, POSIX.1-2008. |
847e0d88 | 97 | .PP |
824eec7e MK |
98 | The variant returning |
99 | .I double | |
100 | also conforms to | |
101 | SVr4, 4.3BSD, C89. | |
47297adb | 102 | .SH SEE ALSO |
fea681da | 103 | .BR abs (3), |
36268806 | 104 | .BR cabs (3), |
f0c34053 | 105 | .BR ceil (3), |
fea681da MK |
106 | .BR floor (3), |
107 | .BR labs (3), | |
108 | .BR rint (3) |