MathF.Log 方法

定義

多載

Log(Single)

傳回指定數字的自然 (底數為 e) 對數。

Log(Single, Single)

傳回指定底數中指定數字的對數。

Log(Single)

來源:
MathF.cs
來源:
MathF.cs
來源:
MathF.cs

傳回指定數字的自然 (底數為 e) 對數。

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

參數

x
Single

要找出其對數的數字。

傳回

下表的其中一個值。

x 參數 傳回值
x 的自然對數,亦即 x log e x
NegativeInfinity
NaN
等於 NaNNaN
等於 PositiveInfinityPositiveInfinity

備註

參數 x 會指定為基底 10 個數字。

此方法會呼叫基礎 C 執行時間,而確切的結果或有效輸入範圍可能會不同作業系統或架構之間的差異。

另請參閱

適用於

Log(Single, Single)

來源:
MathF.cs
來源:
MathF.cs
來源:
MathF.cs

傳回指定底數中指定數字的對數。

public:
 static float Log(float x, float y);
public static float Log (float x, float y);
static member Log : single * single -> single
Public Shared Function Log (x As Single, y As Single) As Single

參數

x
Single

要找出其對數的數字。

y
Single

底數。

傳回

下表的其中一個值。 (+Infinity 代表 PositiveInfinity、-Infinity 代表 NegativeInfinity,NaN 則代表 NaN。)

xnewBase 傳回值
x> 0 (0 <newBase< 1) -或-(newBase> 1) lognewBase(a)
x< 0 (任意值) NaN
(任意值)newBase< 0 NaN
x != 1newBase = 0 NaN
x != 1newBase = +Infinity NaN
x = NAN (任意值) NaN
(任意值)newBase = NAN NaN
(任意值)newBase = 1 NaN
x = 0 0 <newBase< 1 +Infinity
x = 0newBase> 1 -Infinity
x = +Infinity 0 <newBase< 1 -Infinity
x = +InfinitynewBase> 1 +Infinity
x = 1newBase = 0 0
x = 1newBase = +Infinity 0

備註

此方法會呼叫基礎 C 執行時間,而確切的結果或有效輸入範圍可能會不同作業系統或架構之間的差異。

適用於