[#BloombergLP-bdldfp-DecimalUtil-trunc-0af] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalUtil.adoc[DecimalUtil]::trunc :relfileprefix: ../../../ :mrdocs: Return the nearest integral value that is not greater in absolute value than the specified `x`. == Synopsis Declared in `<bdldfp_decimalutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] trunc(xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] x); ---- == Description Special value handling: * if `x` is quiet NaN, quiet NaN is returned. * If `x` is signaling NaN, quiet NaN is returned and the value of the macro `EDOM` is stored into `errno`. * if `x` is +/‐infinity or +/‐0, it is returned unmodified. Examples: `trunc(0.5)` ==> 0.0; trunc(‐0.5) ==> 0.0 [.small]#Created with https://www.mrdocs.com[MrDocs]#