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

Table of contents


NAME

roundf, round, roundl, roundw, roundq, roundll, rounddf, roundd, rounddl, rounddll - round to nearest integer value in floating-point format using fixed rounding

SYNOPSIS

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

#include <mathcw.h>

extern float roundf (float x);

extern double round (double x);

extern long double roundl (long double x);

extern __float80 roundw (__float80 x);

extern __float128 roundq (__float128 x);

extern long_long_double roundll (long_long_double x);

extern decimal_float rounddf (decimal_float x);

extern decimal_double roundd (decimal_double x);

extern decimal_long_double rounddl (decimal_long_double x);

extern decimal_long_long_double rounddll (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.

Caution: Depending on the argument size and precision, the result may be too large to store in a variable of some integer type, even though it is exactly representable as a floating-point value.


RETURN VALUES

For finite nonzero arguments, the returned value is the requisite whole number. For Infinity, NaN, and zero arguments, the returned value is the argument.

ERRORS

None.

SEE ALSO

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