Python math.copysign() Method

Math Methods : Return the value of the first parameter and the sign of the second parameter

Definition and Usage

The math.copysign() method returns a float consisting of the value of the first parameter and the sign(+/-) of the second parameter.

Syntax

math.copysign(x, y)

Parameter Values

Parameter Description
x Required. A number. The return will have the value of this parameter
y Required. A number. The return will have the sign (+/-) of this parameter

Technical Details

Return Value: A float value, which consists of  the value of first parameter, and sign of the second parameter
Python Version: 2.6