function
<cmath> <ctgmath>

# fabs

```double fabs (double x);
```
```     double fabs  (double x);
float fabsf (float x);
long double fabsl (long double x);
```
```     double fabs (double x);
float fabs (float x);
long double fabs (long double x);
```
```     double fabs (double x);
float fabs (float x);
long double fabs (long double x);
Compute absolute value
Returns the absolute value of x: |x|.

Header <tgmath.h> provides a type-generic macro version of this function.
Additional overloads are provided in this header (`<cmath>`) for the integral types: These overloads effectively cast x to a `double` (defined for T being any integral type).

### Parameters

x
Value whose absolute value is returned.

### Return Value

The absolute value of x.

### Example

 ``12345678910`` ``````/* fabs example */ #include /* printf */ #include /* fabs */ int main () { printf ("The absolute value of 3.1416 is %f\n", fabs (3.1416) ); printf ("The absolute value of -10.6 is %f\n", fabs (-10.6) ); return 0; }``````

Output:
 ``` The absolute value of 3.1416 is 3.141600 The absolute value of -10.6 is 10.600000 ```