# 指數與對數函數

本節描述和指數與對數計算相關的函數。所有函數皆可用於資料載入指令碼和圖表運算式。

在下列函數中，參數是運算式，其中 x 和 y 應解譯為真實的值數字。

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ExponentialAndLogarithmicFunctions/exponential-logarithmic-functions.htm)

#### exp

自然指數函數 e^x，將自然對數 e 用作基數。結果是正數。

exp(x )

範例與結果：

`exp(3)` 傳回 20.085。

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ExponentialAndLogarithmicFunctions/exponential-logarithmic-functions.htm)

#### log

x 的自然對數。只有 x&gt; 0 時才定義此函數。結果是數字。

log(x )

範例與結果：

`log(3)` 傳回 1.0986

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ExponentialAndLogarithmicFunctions/exponential-logarithmic-functions.htm)

#### log10

x的常用對數 (基數 10)。只有 x&gt; 0 時才定義此函數。結果是數字。

log10(x )

範例與結果：

`log10(3)` 傳回 0.4771

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ExponentialAndLogarithmicFunctions/exponential-logarithmic-functions.htm)

#### pow

將 x 傳回到 y 的次方。結果是數字。

pow(x,y )

範例與結果：

`pow(3, 3)` 傳回 27

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ExponentialAndLogarithmicFunctions/exponential-logarithmic-functions.htm)

#### sqr

x 平方值 (x 到 2 的次方)。結果是數字。

sqr (x )

範例與結果：

`sqr(3)` 傳回 9

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ExponentialAndLogarithmicFunctions/exponential-logarithmic-functions.htm)

#### sqrt

x 的平方根。只有 x &gt;= 0 時才定義此函數。結果是正數。

sqrt(x )

範例與結果：

`sqrt(3)` 傳回 1.732