##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# abs, labs, llabs, imaxabs

From cppreference.com
< c‎ | numeric‎ | math

Defined in header `<stdlib.h>` |  |
int abs( int n ); |  |
long labs( long n ); |  |
long long llabs( long long n ); |  | (since C99)
Defined in header `<inttypes.h>` |  |
intmax_t imaxabs( intmax_t n ); |  | (since C99)

Computes the absolute value of an integer number.

### [edit] Parameters

n | - | integer value

### [edit] Return value

The absolute value of `n` (i.e. `|n|`)

### [edit] See also

fabs | absolute value of a floating point value (|x|) (function) [edit]
C++ documentation for abs

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/numeric/math/abs&oldid=62556"