Namespaces
Variants
Views
Actions

round, lround, llround

From cppreference.com
< c‎ | numeric‎ | math
Revision as of 15:29, 1 July 2013 by P12bot (Talk | contribs)

 
 
 
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99)
(C99)
(C99)(C99)(C99)
Exponential functions
(C99)
(C99)
(C99)
(C99)
Power functions
(C99)
(C99)
Trigonometric and hyperbolic functions
(C99)
(C99)
(C99)
Error and gamma functions
(C99)
(C99)
(C99)
(C99)
Nearest integer floating point operations
roundlroundllround
(C99)(C99)(C99)
(C99)
(C99)(C99)(C99)
Floating point manipulation functions
(C99)(C99)
(C99)
(C99)
Classification
(C99)
(C99)
(C99)
Macro constants
 
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

Parameters

arg - floating point value

Return value

Nearest integer to arg.

See also

computes largest integer not greater than the given value
(function) [edit]
(C99)(C99)
computes smallest integer not less than the given value
(function) [edit]
(C99)(C99)(C99)
rounds to nearest integer not greater in magnitude than the given value
(function) [edit]