std::abs(int), std::labs, std::llabs
From cppreference.com
Template:cpp/numeric/math/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td>Defined in header
</td>
<cstdlib>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td class="t-dcl-nopad">int abs( int n );
</td>
<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">
<td >long abs( long n );
</td>
<td class="t-dcl-nopad"> </td> <td > Template:mark c++0x feature </td> </tr> <tr class="t-dcl ">
<td >long long abs( long long n );
</td>
<td class="t-dcl-nopad"> </td> <td > Template:mark c++0x feature </td> </tr> <tr class="t-dcl ">
<td class="t-dcl-nopad">long labs( long n );
</td>
<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">
<td >long long llabs( long long n );
</td>
<td class="t-dcl-nopad"> </td> <td > Template:mark c++0x feature </td> </tr> Template:ddcl list end
Computes the absolute value of an integer number.
Parameters
n | - | integer value |
the absolute value of n
(i.e. |n|
)