2.8 Functions
2.8 Functions
Section titled “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)
2.8.1 EXP: Exponential, ex
Section titled “2.8.1 EXP: Exponential, ex”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)Example
Section titled “Example”calc/EXP(10) = 22,026.465...2.8.2 LN: Natural Log, ln()
Section titled “2.8.2 LN: Natural Log, ln()”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)Example
Section titled “Example”calc/LN(5) = 1.609...
calc/LN(EXP(10)) = 10Important notes
Section titled “Important notes”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
2.8.3 SQRT: Square Root, √x
Section titled “2.8.3 SQRT: Square Root, √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)Example
Section titled “Example”calc/SQRT(16) = 42.8.4 LOG: Logarithm Logy(x)
Section titled “2.8.4 LOG: Logarithm Logy(x)”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)
Example
Section titled “Example”calc/LOG(100,10) = 2
calc/LOG(8,2) = 32.8.5 POW: Power, xy
Section titled “2.8.5 POW: Power, xy”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)
Example
Section titled “Example”calc/POW(10,2) = 100
calc/POW(10,-2) = 0.01
calc/POW(2,3) = 8
calc/POW(25,0.5) = 5