Return the integral value nearest to x as a long int.

Synopsis

Declared in <bdldfp_decimalutil.h>

static
long
lround(Decimal32 x);

Description

Return the integral value nearest to the specified x. Round halfway cases away from zero, regardless of the current decimal floating point rounding mode.

Special value handling: * if x is NaN (either quiet or signaling), quiet NaN is returned and the value of the macro EDOM is stored into errno. * if x is +/‐infinity, quite NaN is returned and the value of the macro EDOM is stored into errno. * If the result of the rounding is outside the range of the return type, the macro EDOM is stored into errno.

Examples: lround(0.5) ==> 1.0; lround(‐0.5) ==> ‐1.0

Return Value

integral value nearest to x as a long int

Parameters

Name

Description

x

value to round to nearest long int

Created with MrDocs