double copysign(double x, double y);
copysign returns a value with the magnitude of x and the sign of y.