語言

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 等於 或 NegativeInfinity,則返回值為 PositiveInfinityPositiveInfinity 。 若 x 等於 NaN,則返回值為 NaN。

適用於