Math.CopySign(Double, Double) 方法

定义

返回一个值,它具有 x 的大小和 y 的符号。Returns a value with the magnitude of x and the sign of y.

public:
 static double CopySign(double x, double y);
public static double CopySign (double x, double y);
static member CopySign : double * double -> double
Public Shared Function CopySign (x As Double, y As Double) As Double

参数

x
Double

其大小在结果中使用的数字。A number whose magnitude is used in the result.

y
Double

其符号在结果中使用的数字。A number whose sign is the used in the result.

返回

Double

一个值,它具有 x 的大小和 y 的符号。A value with the magnitude of x and the sign of y.

适用于