##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# round, lround, llround

From cppreference.com
< c‎ | numeric‎ | math

Defined in header `<math.h>` |  |
float roundf( float arg ); |  | (since C99)
double round( double arg ); |  | (since C99)
long double roundl( long double arg ); |  | (since C99)
long lroundf( float arg ); |  | (since C99)
long lround( double arg ); |  | (since C99)
long lroundl( long double arg ); |  | (since C99)
long long llroundf( float arg ); |  | (since C99)
long long llround( double arg ); |  | (since C99)
long long llroundl( long double arg ); |  | (since C99)

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

### [edit] Parameters

arg | - | floating point value

### [edit] Return value

Nearest integer to `arg`.

### [edit] See also

floor | nearest integer not greater than the given value (function) [edit]
ceil | nearest integer not less than the given value (function) [edit]
trunc (C99) | nearest integer not greater in magnitude than the given value (function) [edit]
C++ documentation for round

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/numeric/math/round&oldid=62605"