[#BloombergLP-bdldfp-DecimalUtil-round-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalUtil.adoc[DecimalUtil]::round
:relfileprefix: ../../../
:mrdocs:

Return the integral value nearest to the specified `x`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32]
round(xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] 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 quiet NaN, quiet NaN is returned&period; &ast; If `x` is signaling NaN, quiet NaN is returned and the value of the macro `EDOM` is stored into `errno`&period; &ast; if `x` is &plus;&sol;&hyphen;infinity or &plus;&sol;&hyphen;0, it is returned unmodified&period;

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

== Return Value

integral value nearest to `x`

== Parameters

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


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