Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

會傳回 Double,指定數字的自然對數。

語法

記錄 ( 號碼 )

必要 數位引數 為 Double 或任何大於零的有效 數值運算式 。

註解

自然對數是底數 e 的對數。 常數e 大約是 2.718282。

您可以將 x 的自然對數除以 n 的自然對數來計算任何數位 x 的底數-n 對數,如下所示:

記錄n (x) = Log (x) / Log (n)

下列範例說明自定義 Function ,以計算底數-10 對數:

附註: 下列範例示範如何在 Visual Basic for Applications (VBA) 模組中使用此函數。 如需使用 VBA 的詳細資訊,請在 [搜尋] 旁的下拉式清單中選取 [開發人員參考],並在 [搜尋] 方塊中輸入一個或多個字詞。

Static Function Log10(X)
Log10 = Log(X) / Log(10#)
End Function

查詢範例

Expression

結果​​

SELECT Log (90) AS Logarithm FROM ProductSales GROUP BY Log (90) ;

傳回數位自變數的「記錄」,並顯示在對數欄中。

VBA 範例

此範例使用 Log 函數傳回數位的自然對數。

Dim MyAngle, MyLog
' Define angle in radians.
MyAngle = 1.3
' Calculate inverse hyperbolic sine.
MyLog = Log(MyAngle + Sqr(MyAngle * MyAngle + 1))

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×