Name

llrint

Synopsis

Rounds a floating-point number to a long long integer

#include <math.h>
long longllrint( double x );
long long llrintf( float x );
long long llrintl( long double x );

The llrint() functions round a floating-point number to the next integer value in the current rounding direction. If the result is outside the range of long long, a range error may occur (this is implementation-dependent), and the return value is unspecified.

Example

See the example for the analogous function lrint().

Get C in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.