OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / 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  2013-07-10 "" "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 .sp
39 .BI "double fabs(double " x );
40 .br
41 .BI "float fabsf(float " x );
42 .br
43 .BI "long double fabsl(long double " x );
44 .fi
45 .sp
46 Link with \fI\-lm\fP.
47 .sp
48 .in -4n
49 Feature Test Macro Requirements for glibc (see
50 .BR feature_test_macros (7)):
51 .in
52 .sp
53 .ad l
54 .BR fabsf (),
55 .BR fabsl ():
56 .RS 4
57 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
58 _POSIX_C_SOURCE\ >=\ 200112L;
59 .br
60 or
61 .I cc\ -std=c99
62 .RE
63 .ad b
64 .SH DESCRIPTION
65 These functions return the absolute value of the floating-point
66 number
67 .IR x .
68 .SH RETURN VALUE
69 These functions return the absolute value of
70 .IR x .
71
72 If
73 .I x
74 is a NaN, a NaN is returned.
75
76 If
77 .I x
78 is \-0, +0 is returned.
79
80 If
81 .I x
82 is negative infinity or positive infinity, positive infinity is returned.
83 .SH ERRORS
84 No errors occur.
85 .SH ATTRIBUTES
86 .SS Multithreading (see pthreads(7))
87 The
88 .BR fabs (),
89 .BR fabsf (),
90 and
91 .BR fabsl ()
92 functions are thread-safe.
93 .SH CONFORMING TO
94 C99, POSIX.1-2001.
95 The variant returning
96 .I double
97 also conforms to
98 SVr4, 4.3BSD, C89.
99 .SH SEE ALSO
100 .BR abs (3),
101 .BR cabs (3),
102 .BR ceil (3),
103 .BR floor (3),
104 .BR labs (3),
105 .BR rint (3)
106 .SH COLOPHON
107 This page is part of release 3.68 of the Linux
108 .I man-pages
109 project.
110 A description of the project,
111 information about reporting bugs,
112 and the latest version of this page,
113 can be found at
114 \%http://www.kernel.org/doc/man\-pages/.