Skip to content

2.8 Functions

The mathematical functions give access to the common operations for analysing data and evaluating formulae. The EXP, LN and SQRT functions take the form:

fn(input)

input any valid timeseries input (see section 2.2)

The LOG and POWER functions require a second input and the syntax is:

fn(input, b)

input any valid timeseries input (see section 2.2)

b any valid timeseries input (see section 2.2)

The term “exp(x)” is the same as writing ex or ℯ^x or “e to the x” or “ℯ to the power of x”. In this context, “ℯ” is a universal constant, ℯ = 2.718281828…

calc/EXP(input)
calc/EXP(10) = 22,026.465...

The Natural Log is the inverse of the Exponential function. I.e. ln(ℯx) = x. The syntax for the LN function is:

calc/LN(input)
calc/LN(5) = 1.609...
calc/LN(EXP(10)) = 10

The following should be noted:

  • The ln of a negative number is undefined and will throw a “Not a Number” (NaN) error:

  • ln(0) is undefined and will throw a “Not a Number” (NaN) error:

  • ln(∞)= ∞

  • ln(1)=0

  • ln(e)=1

  • ln(ex) = x

  • eln(x)=x

Square root of a number is a value, which on multiplication by itself, gives the original number. The square root is an inverse method of squaring a number i.e. x2. The syntax for the SQRT function is:

calc/SQRT(input)
calc/SQRT(16) = 4

The Logarithm is the exponent or power to which a base (b) must be raised to return a given number (x).

Logb(x)

The syntax for the LOG function is:

calc/LOG(input, b)

input the number for which to find the LOG - any valid timeseries input (see section 2.2)

b the base in which to calculate — any constant or valid timeseries (see section 2.2)

calc/LOG(100,10) = 2
calc/LOG(8,2) = 3

The POWER function multiplies a number (x) by itself a specified number of times (b). This is often called raising x to the power of b. It is the inverse of the LOG function

xb

The syntax for the POW function is:

calc/POW(input, b)

input the number to multiply (x) - any valid timeseries input (see section 2.2)

b the power, the number of times to multiply the input by itself— any constant or valid timeseries (see section 2.2)

calc/POW(10,2) = 100
calc/POW(10,-2) = 0.01
calc/POW(2,3) = 8
calc/POW(25,0.5) = 5