Everything

lrint / lrintf / lrintl / llrint / llrintf / llrintl


Rounds a floating-point number to the nearest integer according to the current rounding direction.

[Format]

#include <math.h>

long int lrint(double d);

long int lrintf(float d);

long int lrintl(long double d);

long long int llrint(double d);

long long int llrintf(float d);

long long int llrintl(long double d);

[Parameters]

d Value to be rounded to an integer

[Return values]

Normal: d rounded to an integer

Abnormal: Range error: Returns an undetermined value.

[Remarks]

A range error may occur if the absolute value of d is too large.

The return value is unspecified when the rounded value is not in the range of the return value type.