llround(), llroundf(), lround(), lroundf()

convert to nearest integral value 

Function


SYNOPSIS

#include <math.h>

long int lround(double x)

long int lroundf(float x)

long long int llround(double x)

long long int llroundf(float x)


DESCRIPTION

The lround() function returns the integer nearest to its argument x, rounding away from zero in halfway cases. If the rounded result is too large to be represented as a long value, an invalid exception is raised and the return value is undefined. Otherwise, if x is not an integer, lround() may raise an inexact exception. When the rounded result is representable as a long, the expression lround(x) is equivalent to (long)round()(x) (although the former may be more efficient). The llround(), llroundf(), and lroundf() functions differ from lround() only in their input and output types.


CONFORMANCE

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:
lrint(), math(), rint(), round()


PTC MKS Toolkit 10.4 Documentation Build 39.