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

Table of contents


NAME

lroundf, lround, lroundl, lroundw, lroundq, lroundll, lrounddf, lroundd, lrounddl, lrounddll - round to nearest integer value with fixed rounding

SYNOPSIS

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

#include <mathcw.h>

extern long int lroundf (float x);

extern long int lround (double x);

extern long int lroundl (long double x);

extern long int lroundw (__float80 x);

extern long int lroundq (__float128 x);

extern long int lroundll (long_long_double x);

extern long int lrounddf (decimal_float x);

extern long int lroundd (decimal_double x);

extern long int lrounddl (decimal_long_double x);

extern long int lrounddll (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, rounding halfway cases away from zero, regardless of the current rounding direction.

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, 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

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