Functions
math.pow()
`base` raised to the power of `exponent`. The language has no exponentiation operator: a token for one exists in the lexer but no rule reaches it, so source containing `^` does not parse. This function is how you raise a number to a power.
Syntax · 1 of 4
math.pow(const float base, const float exponent) → const float
Arguments
base required const float Specify the base to use. exponent required const float Specifies the exponent. Return Type
const float Syntax · 2 of 4
math.pow(input float base, input float exponent) → input float
Arguments
base required input float Specify the base to use. exponent required input float Specifies the exponent. Return Type
input float Syntax · 3 of 4
math.pow(simple float base, simple float exponent) → simple float
Arguments
base required simple float Specify the base to use. exponent required simple float Specifies the exponent. Return Type
simple float Syntax · 4 of 4
math.pow(series float base, series float exponent) → series float
Arguments
base required series float Specify the base to use. exponent required series float Specifies the exponent. Return Type
series float Example
//@lipi=2
indicator("math.pow Example", overlay=false)
squared = math.pow(close - open, 2)
plot(squared, title="Squared Body", color=color.blue)