Return a value with the magnitude of x and the sign of y.

Synopsis

Declared in <bdldfp_decimalimputil.h>

Description

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.

Examples: copysign( 5.0, ‐2.0) ==> ‐5.0; copysign(‐5.0, ‐2.0) ==> ‐5.0

Return Value

a value with the magnitude of x and the sign of y

Parameters

Name

Description

x

value supplying the magnitude

y

value supplying the sign

Created with MrDocs