Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | numeric‎ | math
(sync)
m (Text replace - "/sidebar" to "/navbar")
Line 1: Line 1:
 
{{cpp/title|round | lround | llround}}
 
{{cpp/title|round | lround | llround}}
{{cpp/numeric/math/sidebar}}
+
{{cpp/numeric/math/navbar}}
 
{{ddcl list begin}}
 
{{ddcl list begin}}
 
{{ddcl list header | cmath}}
 
{{ddcl list header | cmath}}

Revision as of 13:48, 15 June 2012

 
 
 
 

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 >
float round( float arg );
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

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

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end

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

Parameters

arg - floating point value

Return value

Nearest integer to arg.

Return value
math-round away zero.svg
Argument

See also

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