[#BloombergLP-bdldfp-DecimalImpUtil-copySign-08] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalImpUtil.adoc[DecimalImpUtil]::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_decimalimputil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[DecimalImpUtil::ValueType32] copySign( xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[ValueType32] x, xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[ValueType32] 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]#