你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

log2()

Applies to: ✅ Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

The logarithm is the base-2 logarithm: the inverse of the exponential function (exp) with base 2.

Syntax

log2(number)

Learn more about syntax conventions.

Parameters

Name Type Required Description
number real ✔️ The number for which to calculate the base-2 logarithm.

Returns

  • The logarithm is the base-2 logarithm: the inverse of the exponential function (exp) with base 2.
  • null if the argument is negative or null or can't be converted to a real value.

Example

print result=log2(5)

Output

result
2.3219280948873622
  • For natural (base-e) logarithms, see log().
  • For common (base-10) logarithms, see log10().