RINT(3) Library Functions Manual RINT(3)

rintround-to-nearest integral value

#include <math.h>

double rint(double x);

The rint() function returns the integral value (represented as a double ) nearest x in the direction of the current rounding mode. The current rounding mode is implementation-dependent.

If the current rounding mode rounds toward negative infinity, then rint() is identical to . If the current rounding mode rounds toward positive infinity, then rint() is identical to .

Upon successful completion, the rint() function returns the integer (represented as a double precision number) nearest x in the direction of the current rounding mode.

When x is ±Inf, rint() returns x.

If the value of x is NaN, NaN is returned and may be set to [EDOM].

The rint() function may fail if:

The x argument is NaN.

None.

None.

None.

abs(3) , isnan(3) , <math.h> .

February 1997 posix.fail