]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/fabs.3
Many pages: Fix style issues reported by `make lint-groff`
[thirdparty/man-pages.git] / man3 / fabs.3
CommitLineData
fea681da
MK
1.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2.\"
5fbde956 3.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
4.\"
5.\" References consulted:
6.\" Linux libc source code
7.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
8.\" 386BSD man pages
9.\" Modified Sat Jul 24 19:42:04 1993 by Rik Faith (faith@cs.unc.edu)
10.\" Added fabsl, fabsf, aeb, 2001-06-07
11.\"
1ae6b2c7 12.TH FABS 3 2021-03-22 GNU "Linux Programmer's Manual"
fea681da
MK
13.SH NAME
14fabs, fabsf, fabsl \- absolute value of floating-point number
2af19291
AC
15.SH LIBRARY
16Math library
8fc3b2cf 17.RI ( libm ", " \-lm )
fea681da
MK
18.SH SYNOPSIS
19.nf
20.B #include <math.h>
68e4db0a 21.PP
fea681da 22.BI "double fabs(double " x );
fea681da 23.BI "float fabsf(float " x );
fea681da
MK
24.BI "long double fabsl(long double " x );
25.fi
68e4db0a 26.PP
d39ad78f 27.RS -4
824eec7e
MK
28Feature Test Macro Requirements for glibc (see
29.BR feature_test_macros (7)):
d39ad78f 30.RE
68e4db0a 31.PP
824eec7e
MK
32.BR fabsf (),
33.BR fabsl ():
9d2adbae 34.nf
5c10d2c5 35 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
9d2adbae
MK
36 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
37 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
38.fi
fea681da 39.SH DESCRIPTION
0d9df44e 40These functions return the absolute value of the floating-point
022671eb
MK
41number
42.IR x .
824eec7e
MK
43.SH RETURN VALUE
44These functions return the absolute value of
45.IR x .
847e0d88 46.PP
824eec7e
MK
47If
48.I x
49is a NaN, a NaN is returned.
847e0d88 50.PP
824eec7e
MK
51If
52.I x
53is \-0, +0 is returned.
847e0d88 54.PP
824eec7e
MK
55If
56.I x
57is negative infinity or positive infinity, positive infinity is returned.
fea681da 58.SH ERRORS
824eec7e 59No errors occur.
594e3173 60.SH ATTRIBUTES
6904b640
MK
61For an explanation of the terms used in this section, see
62.BR attributes (7).
c466875e
MK
63.ad l
64.nh
6904b640
MK
65.TS
66allbox;
c466875e 67lbx lb lb
6904b640
MK
68l l l.
69Interface Attribute Value
70T{
594e3173
PH
71.BR fabs (),
72.BR fabsf (),
594e3173 73.BR fabsl ()
6904b640
MK
74T} Thread safety MT-Safe
75.TE
c466875e
MK
76.hy
77.ad
78.sp 1
47297adb 79.SH CONFORMING TO
9a74e018 80C99, POSIX.1-2001, POSIX.1-2008.
847e0d88 81.PP
824eec7e
MK
82The variant returning
83.I double
84also conforms to
85SVr4, 4.3BSD, C89.
47297adb 86.SH SEE ALSO
fea681da 87.BR abs (3),
36268806 88.BR cabs (3),
f0c34053 89.BR ceil (3),
fea681da
MK
90.BR floor (3),
91.BR labs (3),
92.BR rint (3)