[#BloombergLP-bdldfp-DecimalImpUtil-lround-04]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalImpUtil.adoc[DecimalImpUtil]::lround
:relfileprefix: ../../../
:mrdocs:

Return `x` rounded to the nearest `long int`&period;

== Synopsis

Declared in `&lt;bdldfp&lowbar;decimalimputil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
long
lround(xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[ValueType32] x);
----

== Description

Round halfway cases away from zero, regardless of the current decimal floating point rounding mode&period;

Special value handling&colon; &ast; if `x` is NaN (either quiet or signaling), quiet NaN is returned and the value of the macro `EDOM` is stored into `errno`&period; &ast; if `x` is &plus;&sol;&hyphen;infinity, quite NaN is returned and the value of the macro `EDOM` is stored into `errno`&period; &ast; If the result of the rounding is outside the range of the return type, the macro `EDOM` is stored into `errno`&period;

Examples&colon; `lround(0&period;5)` &equals;&equals;&gt; 1&period;0&semi; lround(&hyphen;0&period;5) &equals;&equals;&gt; &hyphen;1&period;0

== Return Value

`x` rounded to the nearest `long int`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *x*
| value to round
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
