LRINT(3)

NAME
lrint, lrintf, llrint, llrintf - round to integer

SYNOPSIS

#include <math.h>

long int lrint(double x);

long int lrintf(float x);

long long int llrint(double x);

long long int llrintf(float x);

DESCRIPTION

The lrint and llrint functions round their argument to the nearest integer value, using the current rounding direction. If the rounded value is outside the range of the return type, the numeric result is unspecified. A range error may occur if the magnitude of x is too large. The "inexact" floating-point exception is raised in implementations that support it when the result differs in value from the argument (i.e., when a fraction actually has been truncated).

RETURNS

x rounded to an integral value, using the current rounding direction.

SEE ALSO

lround

PORTABILITY

ANSI C, POSIX