tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / fabs.3
bloba3febcfbb5b48a50b5c176270b430783bda88f8f
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 Sat Jul 24 19:42:04 1993 by Rik Faith (faith@cs.unc.edu)
11 .\" Added fabsl, fabsf, aeb, 2001-06-07
12 .\"
13 .TH fabs 3 (date) "Linux man-pages (unreleased)"
14 .SH NAME
15 fabs, fabsf, fabsl \- absolute value of floating-point number
16 .SH LIBRARY
17 Math library
18 .RI ( libm ", " \-lm )
19 .SH SYNOPSIS
20 .nf
21 .B #include <math.h>
22 .PP
23 .BI "double fabs(double " x );
24 .BI "float fabsf(float " x );
25 .BI "long double fabsl(long double " x );
26 .fi
27 .PP
28 .RS -4
29 Feature Test Macro Requirements for glibc (see
30 .BR feature_test_macros (7)):
31 .RE
32 .PP
33 .BR fabsf (),
34 .BR fabsl ():
35 .nf
36     _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
37         || /* Since glibc 2.19: */ _DEFAULT_SOURCE
38         || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
39 .fi
40 .SH DESCRIPTION
41 These functions return the absolute value of the floating-point
42 number
43 .IR x .
44 .SH RETURN VALUE
45 These functions return the absolute value of
46 .IR x .
47 .PP
49 .I x
50 is a NaN, a NaN is returned.
51 .PP
53 .I x
54 is \-0, +0 is returned.
55 .PP
57 .I x
58 is negative infinity or positive infinity, positive infinity is returned.
59 .SH ERRORS
60 No errors occur.
61 .SH ATTRIBUTES
62 For an explanation of the terms used in this section, see
63 .BR attributes (7).
64 .ad l
65 .nh
66 .TS
67 allbox;
68 lbx lb lb
69 l l l.
70 Interface       Attribute       Value
72 .BR fabs (),
73 .BR fabsf (),
74 .BR fabsl ()
75 T}      Thread safety   MT-Safe
76 .TE
77 .hy
78 .ad
79 .sp 1
80 .SH STANDARDS
81 C99, POSIX.1-2001, POSIX.1-2008.
82 .PP
83 The variant returning
84 .I double
85 also conforms to
86 SVr4, 4.3BSD.
87 .SH SEE ALSO
88 .BR abs (3),
89 .BR cabs (3),
90 .BR ceil (3),
91 .BR floor (3),
92 .BR labs (3),
93 .BR rint (3)