MathF.Abs(Single) 方法

定义

返回单精度浮点数的绝对值。

public:
 static float Abs(float x);
public static float Abs(float x);
static member Abs : single -> single
Public Shared Function Abs (x As Single) As Single

参数

x
Single

要获取其绝对值的数字。

返回

的绝对值 x

注解

a Single 的绝对值是其数值而不带符号。 例如,1.2e-03 和 -1.2e03 的绝对值为 1.2e03。

如果 x 等于 NegativeInfinityPositiveInfinity等于,则返回值为 PositiveInfinity。 如果 x 等于 NaN,则返回值为 NaN

适用于