Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | numeric‎ | math
m (+see also valarray and complex overloads)
Line 35: Line 35:
 
{{dcl list begin}}
 
{{dcl list begin}}
 
{{dcl list template | cpp/numeric/math/dcl list fabs}}
 
{{dcl list template | cpp/numeric/math/dcl list fabs}}
 +
{{dcl list template | cpp/numeric/complex/dcl list abs}}
 +
{{dcl list template | cpp/numeric/valarray/dcl list abs}}
 
{{dcl list end}}
 
{{dcl list end}}

Revision as of 13:48, 10 November 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 class="t-dcl-nopad">
long      abs( long n );
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">

<td >
long long abs( long long n );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 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++11 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|)

See also

Template:cpp/numeric/math/dcl list fabsTemplate:cpp/numeric/complex/dcl list absTemplate:cpp/numeric/valarray/dcl list abs