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 off to nearest whole number

&pagelevel(4)&pagelevel

Definition

#include <math.h>

long int lround(double x);

long int lroundf (float x);

long int lroundl (long double x);

Each of the functions returns the whole number nearest to x, represented as a number of
type long int.

The return value is independent of the defined rounding mode. If the difference between x
and the rounded result is exactly 0.5, the larger whole number is returned.

Return val.

integer

represented as a number of type long long int
if successful.

undefined

in the event of an overflow or underflow, errno is set to ERANGE to indicate
the error.

See also

abs, ceil, floor, llrint, llround, lrint, rint, round