copy_sign

Makes a number positive or negative based on the sign of the sign input.

Inputs

value

The value to modify.

sign

A value used to determine the sign of the output.

Output

output

If sign is negative, the output value will be negative. If sign is positive, the output value will be positive. The magnitude of the input value is preserved.