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

Table of contents


NAME

llrintf, llrint, llrintl, llrintw, llrintq, llrintll, llrintdf, llrintd, llrintdl, llrintdll - 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 long int llrintf (float x);

extern long long int llrint (double x);

extern long long int llrintl (long double x);

extern long long int llrintw (__float80 x);

extern long long int llrintq (__float128 x);

extern long long int llrintll (long_long_double x);

extern long long int llrintdf (decimal_float x);

extern long long int llrintd (decimal_double x);

extern long long int llrintdl (decimal_long_double x);

extern long long int llrintdll (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 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 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), llround(3CW), lrint(3CW), lround(3CW), modf(3CW), nearbyint(3CW), rint(3CW), round(3CW), trunc(3CW).