Copyright © 1997 The Open Group

rint - round-to-nearest integral value

`#include <math.h> double rint(double`

x);

Therint()function returns the integral value (represented as adouble) nearestxin 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 tofloor(). If the current rounding mode rounds toward positive infinity, thenrint()is identical toceil().

Upon successful completion, therint()function returns the integer (represented as a double precision number) nearestxin the direction of the current rounding mode.When

xis ±Inf,rint()returnsx.If the value of

xis NaN, NaN is returned anderrnomay be set to [EDOM].

Therint()function may fail if:

- [EDOM]
- The
xargument is NaN.

None.

None.

None.

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

Copyright © 1997 The Open Group

[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]