std::abs(int), std::labs, std::llabs

From Cppreference

Jump to: navigation, search
Defined in header <cstdlib>

int       abs( int n );

long      abs( long n );

long long abs( long long n );
(C++11 feature)
long       labs( long n );

long long llabs( long long n );
(C++11 feature)

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

abs(float)
fabs
absolute value of an absolute value of an floating point value (|x|)
(function)