[#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`&period; If `x` is NaN, then NaN with the sign of `y` is returned&period;

== Synopsis

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

[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&colon; `copysign( 5&period;0, &hyphen;2&period;0)` &equals;&equals;&gt; &hyphen;5&period;0&semi; `copysign(&hyphen;5&period;0, &hyphen;2&period;0)` &equals;&equals;&gt; &hyphen;5&period;0


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