[#BloombergLP-bdldfp-DecimalUtil-copySign-064] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalUtil.adoc[DecimalUtil]::copySign :relfileprefix: ../../../ :mrdocs: Return a decimal value with the magnitude of the specifed `x` and the sign of the specified `y`. If `x` is NaN, then NaN with the sign of `y` is returned. == Synopsis Declared in `<bdldfp_decimalutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] copySign( xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] x, xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] y); ---- == Description Examples: `copySign( 5.0, ‐2.0)` ==> ‐5.0; `copySign(‐5.0, ‐2.0)` ==> 5.0 [.small]#Created with https://www.mrdocs.com[MrDocs]#