nearbyint(), nearbyintf(), rint(), rintf(), lrint(), lrintf(), llrint(), llrintf()

round to integral value in floating-point format 

Function


SYNOPSIS

#include <math.h>

double nearbyint(double x)

float nearbyintf(float x)

double rint(double x)

float rintf(float x)

long int lrint(double x)

long int lrintf(float x)

long long int llrint(double x)

long long int llrintf(float x)


DESCRIPTION

The rint() function returns the integral value (represented as a double precision number) nearest to x according to the prevailing rounding mode.

The rintf() function is a single-precision version of rint().

The lrint() function is a long int version of rint().

The lrintf() function is a long int version of rintf().

The llrint() function is a long long int version of rint().

The llrintf() function is a long long int version of rintf().

The nearbyint(), and nearbyintf() functions perform the same operation, except that they do not raise an inexact exception.


PARAMETERS

x 

Is the floating point or double precision value to round.


RETURN VALUES

The rint() function returns the integral value nearest to x.

If x is +Infinity or -Infinity, rint() returns x.

If x is NaN, NaN is returned.


CONFORMANCE

rint() class of functions conform to ANSI/ISO 9899:1999 'ISO C99'.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
abs(), ceil(), fabs(), floor(), isnan(), math()


PTC MKS Toolkit 10.4 Documentation Build 39.