Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/numeric/math/abs"

From cppreference.com
< cpp‎ | numeric‎ | math
m (Text replace - "{{params}}" to "===Parameters===")
m (Text replace - "{{returns}}" to "===Return value===")
Line 29: Line 29:
  
 
<!-- ======== -->
 
<!-- ======== -->
{{returns}}
+
===Return value===
  
 
the absolute value of {{tt|n}} (i.e. {{tt|{{!}}n{{!}}}})
 
the absolute value of {{tt|n}} (i.e. {{tt|{{!}}n{{!}}}})

Revision as of 17:48, 2 August 2011

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

Return value

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

Template:see also

Template:cpp/numeric/math/dcl list fabs