MathF.Log 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Log(Single) |
傳回指定數字的自然 (底數為 |
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 |
等於 NaN | NaN |
等於 PositiveInfinity | PositiveInfinity |
備註
參數 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。)
x | newBase | 傳回值 |
---|---|---|
x
> 0 | (0 <newBase < 1) -或-(newBase > 1) | lognewBase(a) |
x
< 0 | (任意值) | NaN |
(任意值) |
newBase
< 0 | NaN |
x != 1 |
newBase = 0 | NaN |
x != 1 |
newBase = +Infinity | NaN |
x = NAN | (任意值) | NaN |
(任意值) |
newBase = NAN | NaN |
(任意值) |
newBase = 1 | NaN |
x = 0 | 0 <newBase < 1 | +Infinity |
x = 0 |
newBase
> 1 | -Infinity |
x = +Infinity | 0 <newBase < 1 | -Infinity |
x = +Infinity |
newBase
> 1 | +Infinity |
x = 1 |
newBase = 0 | 0 |
x = 1 |
newBase = +Infinity | 0 |
備註
此方法會呼叫基礎 C 執行時間,而確切的結果或有效輸入範圍可能會不同作業系統或架構之間的差異。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應