Chapter Contents

Previous

Next
rint

rint



Convert to floating-point integer

Portability: C99


SYNOPSIS
DESCRIPTION
RETURN VALUE
IMPLEMENTATION
RELATED FUNCTIONS
SEE ALSO


SYNOPSIS

   #include <math.h>

double rint(double x);
float rintf(float x);
long double rintl(long double x);


DESCRIPTION

rint converts its argument to an integral value using the current rounding mode, and returns it as a floating-point value. For binary floating point, The inexact floating-point exception is raised if the argument differs from the result.

The function name rintf should be used for float arguments, and rintl for long double arguments. Alternately, if the header file tgmath.h is included, rint may be used with any numeric argument type.


RETURN VALUE

rint returns its argument, converted to an integer.


IMPLEMENTATION

rint is implemented as a built-in function unless it is undefined by a #undef statement.


RELATED FUNCTIONS

ceil, floor, llrint, llround, lrint, lround, nearbyint, round, trunc


SEE ALSO

"Mathematical Functions" in Chapter 2, "Function Categories"


Chapter Contents

Previous

Next

Top of Page

Copyright © 2004 by SAS Institute Inc., Cary, NC, USA. All rights reserved.