NAME
rint —
round-to-nearest integral value
SYNOPSIS
#include <math.h> double rint(double x);
DESCRIPTION
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 floor(). If the current rounding mode rounds toward positive infinity, then rint() is identical to ceil().
RETURN VALUE
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 errno may be set to [EDOM].
ERRORS
The rint() function may fail if:
- [EDOM]
- The x argument is NaN.
EXAMPLES
None.
APPLICATION USAGE
None.
FUTURE DIRECTIONS
None.