Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

lround, lroundf, lroundl - round up to next integer value (long int)

&pagelevel(4)&pagelevel

Syntax

#include <math.h>

long int lround (double x);

long int lroundf (float x);

long int lroundl (long double x); 

Description

The functions return the integer value (displayed as a number of type long int) nearest to x.

The returned value does not depend on the rounding mode currently set. If the difference between x and the rounded result is exactly 0.5, the next highest integer is returned.

Return val.

Integer value (type long int) nearest to x



if successful.

 

Undefined

for overflow or underflow. errno is set to ERANGE to indicate an error.

See also

abs(), ceil(), floor(), llrint(), llround(), lrint(), rint(), round().