1FABS(3) Linux Programmer's Manual FABS(3)
2
3
4
6 fabs, fabsf, fabsl - absolute value of floating-point number
7
9 #include <math.h>
10
11 double fabs(double x);
12 float fabsf(float x);
13 long double fabsl(long double x);
14
15 Link with -lm.
16
17 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19 fabsf(), fabsl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
20 || _ISOC99_SOURCE; or cc -std=c99
21
23 The fabs() functions return the absolute value of the floating-point
24 number x.
25
27 These functions return the absolute value of x.
28
29 If x is a NaN, a NaN is returned.
30
31 If x is -0, +0 is returned.
32
33 If x is negative infinity or positive infinity, positive infinity is
34 returned.
35
37 No errors occur.
38
40 C99, POSIX.1-2001. The variant returning double also conforms to SVr4,
41 4.3BSD, C89.
42
44 abs(3), cabs(3), ceil(3), floor(3), labs(3), rint(3)
45
47 This page is part of release 3.22 of the Linux man-pages project. A
48 description of the project, and information about reporting bugs, can
49 be found at http://www.kernel.org/doc/man-pages/.
50
51
52
53 2008-08-05 FABS(3)