Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | numeric‎ | math
Revision as of 16:53, 2 August 2011 by P12bot (Talk | contribs)

Template:cpp/numeric/math/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <cstdlib>
</td>

<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

Template:returns

the absolute value of n (i.e. |n|)

Template:see also

Template:cpp/numeric/math/dcl list fabs