语言

Decimal.Sign(Decimal) 方法

定义

计算值的符号。

public:
 static int Sign(System::Decimal d) = System::Numerics::INumber<System::Decimal>::Sign;
public static int Sign(decimal d);
static member Sign : decimal -> int
Public Shared Function Sign (d As Decimal) As Integer

参数

d
Decimal

要计算其符号的值。

返回

如果 d 为正值, Zero 则 d 为零,如果为负值,则为负值 d 。

实现

注解

建议分别返回10函数和-1函数。

适用于