Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

round, roundf, roundl - round up to next integer value

&pagelevel(4)&pagelevel

Syntax

#include <math.h>

double round(double x);

float roundf (float x);

long double roundl (long double x); 

Description

The functions return the integer value represented as a floating-point value nearest to x.
round() represents the result as a number of type double, roundf() as a number of type
float and roundl() as a number of type long double.

The returned value is rounded according to the currently set rounding mode of the
computer. If the default mode is set to ’round-to-nearest’ and the difference between x and
the rounded result is exactly 0.5, the next even integer is returned.

Return val.

Integer value

represented as a number of type double, float or long double.

See also

abs(), ceil(), floor(), llrint(), llround(), lrint(), lround(), rint()