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

From cppreference.com
Jump to: navigation, search
Defined in header <cstdlib>
int       abs( int n );
long      abs( long n );
long long abs( long long n );
(since C++11)
long       labs( long n );
long long llabs( long long n );
(since C++11)
Defined in header <cinttypes>
(since C++11)
(since C++11)

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

absolute value of a floating point value (|x|)
(function) [edit]
returns the magnitude of a complex number
(function template) [edit]
applies the function std::abs to each element of valarray
(function template) [edit]

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox