1FABS(3)                    Linux Programmer's Manual                   FABS(3)
2
3
4

NAME

6       fabs, fabsf, fabsl - absolute value of floating-point number
7

SYNOPSIS

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():
20           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
21               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
22               || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
23

DESCRIPTION

25       These  functions return the absolute value of the floating-point number
26       x.
27

RETURN VALUE

29       These functions return the absolute value of x.
30
31       If x is a NaN, a NaN is returned.
32
33       If x is -0, +0 is returned.
34
35       If x is negative infinity or positive infinity,  positive  infinity  is
36       returned.
37

ERRORS

39       No errors occur.
40

ATTRIBUTES

42       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
43       tributes(7).
44
45       ┌────────────────────────────────────────────┬───────────────┬─────────┐
46Interface                                   Attribute     Value   
47       ├────────────────────────────────────────────┼───────────────┼─────────┤
48fabs(), fabsf(), fabsl()                    │ Thread safety │ MT-Safe │
49       └────────────────────────────────────────────┴───────────────┴─────────┘
50

CONFORMING TO

52       C99, POSIX.1-2001, POSIX.1-2008.
53
54       The variant returning double also conforms to SVr4, 4.3BSD, C89.
55

SEE ALSO

57       abs(3), cabs(3), ceil(3), floor(3), labs(3), rint(3)
58

COLOPHON

60       This page is part of release 5.12 of the Linux  man-pages  project.   A
61       description  of  the project, information about reporting bugs, and the
62       latest    version    of    this    page,    can     be     found     at
63       https://www.kernel.org/doc/man-pages/.
64
65
66
67                                  2021-03-22                           FABS(3)
Impressum