LRINT 3CW "09 March 2006" "mathcw-1.00"

Table of contents


NAME

lrintf, lrint, lrintl, lrintw, lrintq, lrintll, lrintdf, lrintd, lrintdl, lrintdll - round to nearest integer value using current rounding direction

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern long int lrintf (float x);

extern long int lrint (double x);

extern long int lrintl (long double x);

extern long int lrintw (__float80 x);

extern long int lrintq (__float128 x);

extern long int lrintll (long_long_double x);

extern long int lrintdf (decimal_float x);

extern long int lrintd (decimal_double x);

extern long int lrintdl (decimal_long_double x);

extern long int lrintdll (decimal_long_long_double x);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Compute the whole number nearest x in the direction of the current IEEE 754 rounding mode.

RETURN VALUES

For finite nonzero arguments, the returned value is the requisite whole number converted to type long, if that is representable. Otherwise, the returned value is the nearest representable integer value.

ERRORS

If the argument is a NaN, the result is the most negative integer representable in type long, errno is set to EDOM, and in IEEE 754 arithmetic, the invalid exception flag is raised. If the argument is finite, but the result is not representable in type long long, or the argument is +Infinity or -Infinity, the nearest such integer value is returned, errno is set to ERANGE, and the IEEE 754 invalid exception flag is raised.

SEE ALSO

ceil(3CW), floor(3CW), llrint(3CW), llround(3CW), lround(3CW), modf(3CW), nearbyint(3CW), rint(3CW), round(3CW), trunc(3CW).