Namespaces
Variants
Views
Actions

std::round, std::lround, std::llround

From cppreference.com
< cpp‎ | numeric‎ | math
Revision as of 17:21, 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 <cmath>
</td>

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

<td >
int round( float arg );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
int round( double arg );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
int round( long double arg );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
long lround( float arg );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
long lround( double arg );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
long lround( long double arg );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
long long llround( float arg );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
long long llround( double arg );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
long long llround( long double arg );
</td>

<td class="t-dcl-nopad"> </td> <td > Template:mark c++11 feature </td> </tr> Template:ddcl list end

Computes nearest integer to arg. Number is rounded away from zero in halfway cases

Template:params

arg - floating point value

Template:returns

nearest integer to arg.

Template:see also

Template:cpp/numeric/math/dcl list floorTemplate:cpp/numeric/math/dcl list ceilTemplate:cpp/numeric/math/dcl list trunc