Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Mathematical Library Functionsrint(3M)


NAME

 rint - round-to-nearest integral value

SYNOPSIS

 
cc [ flag ... ] file ... -lm [ library ... ]
#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 IEEE754 rounding mode.

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

RETURN VALUES

 

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

When x is +-Inf, rint() returns x.

If the value of x is NaN, NaN is returned.

ERRORS

 

No errors will occur.

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelMT-Safe

SEE ALSO

 

ceil(3M), floor(3M), isnan(3M), attributes(5)


SunOS 5.9Go To TopLast Changed 29 Dec 1996

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.