The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 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.

 SEE ALSO

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

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]