Difference between revisions of "cpp/numeric/math/abs"
From cppreference.com
m (Use since= and until= params of {{dcl}} template.) |
(+see c) |
||
Line 35: | Line 35: | ||
===Return value=== | ===Return value=== | ||
− | + | The absolute value of {{tt|n}} (i.e. {{tt|{{!}}n{{!}}}}). | |
− | + | ||
===See also=== | ===See also=== | ||
− | |||
{{dsc begin}} | {{dsc begin}} | ||
{{dsc inc | cpp/numeric/math/dsc fabs}} | {{dsc inc | cpp/numeric/math/dsc fabs}} | ||
{{dsc inc | cpp/numeric/complex/dsc abs}} | {{dsc inc | cpp/numeric/complex/dsc abs}} | ||
{{dsc inc | cpp/numeric/valarray/dsc abs}} | {{dsc inc | cpp/numeric/valarray/dsc abs}} | ||
+ | {{dsc see c | c/numeric/math/abs | abs | labs | llabs}} | ||
{{dsc end}} | {{dsc end}} | ||
Revision as of 05:39, 28 August 2013
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>
|
||
std::intmax_t abs( std::intmax_t n ); |
(since C++11) | |
std::intmax_t imaxabs( std::intmax_t n ); |
(since C++11) | |
Computes the absolute value of an integer number.
Parameters
n | - | integer value |
Return value
The absolute value of n
(i.e. |n|
).
See also
(C++11)(C++11) |
absolute value of a floating point value (|x|) (function) |
returns the magnitude of a complex number (function template) | |
applies the function abs to each element of valarray (function template) | |
C documentation for abs, labs, llabs
|