Skip to main content
Version: 2.15.X

Math Functions

Math functions provide means for performing complex mathematical calculations.

The examples for each function use the following notation:

  • Square brackets ([]) indicate arrays.
  • Curly braces ({}) indicate groups.
  • Arrows (==>) separate inputs and outputs. Inputs are shown on the left side of the arrow. Outputs are shown on the right side of the arrow.

Abs

The Abs function returns the absolute value of the input.

Usage Information

CategoryDetails
Number of Arguments1
Mandatory Argument Names and Datatypesarg: An integer or float.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)Integer or float. The output datatype matches the input datatype.

Examples

abs(-9.6) => 9.6
abs(12) => 12
abs(-1E-6) => -1000000

abs([-1,-2,-3]) ==> [1,2,3]

abs({-1,-2,-3}) ==> {1,2,3}

abs({[-1,-2,-3],[-2,3,4],[-3,-4,-5]}) ==> {[1,2,3],[2,3,4],[3,4,5]}

ln

The ln function returns the natural log of the input.

Usage Information

CategoryDetails
Number of Arguments1
Mandatory Argument Names and Datatypesarg: An integer or float.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)Float

Examples

ln(-9.6) => null
ln(12) => 2.48490664979
ln(1E-6) => -13.815510558

ln([1,2,3]) ==> [0.0,0.69314718056,1.09861228867]

ln({1,2,3}) ==> {0.0,0.69314718056,1.09861228867}

ln({[1,2,3],[1,2,3],[1,2,3]}) ==> {[0.0,0.69314718056,1.09861228867],[0.0,0.69314718056,1.09861228867],[0.0,0.69314718056,1.09861228867]}

log10

The log10 function returns the common log of the input.

Usage Information

CategoryDetails
Number of ArgumentsTBD
Mandatory Argument Names and Datatypesarg: An integer or float.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)Float

Examples

log10(-9.6) => null?
log10(12) => 1.07918124605
log10(1E-6) => -6.0

log10([10,100,1000]) ==> [1.0,2.0,3.0]
log10({10,100,1000}) ==> {1.0,2.0,3.0}

log10({[10,100,1000,3],[10,100,1000],[10,100,1000]}) ==> {[1.0,2.0,3.0],[1.0,2.0,3.0],[1.0,2.0,3.0]}

Power

The Power function calculates exponential values by taking an entered value and raising it to the specified power.

Usage Information

CategoryDetails
Number of Arguments2
Mandatory Argument Names and Datatypes
  • base: An integer or float to use as the base value.
  • exp: An integer or float to use as the power.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)Integer

Examples

pow(9,2) ==> 81
pow(2,|2,3,4|) ==> |4,8,16|

pow([1,2,3],2) ==> [1,4,9]

pow({1,2,3},2) ==> {1,4,8}
pow({1,2,3},{1,2,3}) ==> {1,4,27}

pow({[1,2,3],[1,2,3],[1,2,3]},2) ==> pow([1,4,9],[1,4,9],[1,4,9])

Random Int

The Random Int function returns a random integer.

Usage Information

CategoryDetails
Number of Arguments0
Mandatory Argument Names and DatatypesN/A
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)Integer

Examples

rand() ==> 14

Round

The Round function rounds an entered float (floating point number) to the specified number of places.

Usage Information

CategoryDetails
Number of Arguments2
Mandatory Argument Names and Datatypes
  • arg: A float to round.
  • digits: An integer specifying the number of places to round (0 by default).
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)Float

Examples

round(7.859327) ==> 8.0
round(7.859327,2) ==> 7.86

round({103.383,7.863,6.3477},2) ==> {103.38,7.86,6.35}
round({103.383,7.863,6.3477},{2,3,5}) ==> {103.38,7.863,6.3477}

round([103.383,7.863,6.3477],2) ==> [103.38,7.86,6.35]

round({[103.383,7.863,6.3477],[103.383,7.863,6.3477],[103.383,7.863,6.3477]},2) ==> {[103.38,7.86,6.35],[103.38,7.86,6.35],[103.38,7.86,6.35]}

Sqrt

The Sqrt function returns the square root of the entered value.

Note

The input must be positive. Otherwise, the Sqrt function returns an error.

Usage Information

CategoryDetails
Number of Arguments1
Mandatory Argument Names and Datatypesarg: An integer or float.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)Float

Examples

sqrt(-9.6) => null?
sqrt(16) => 4.0
sqrt(1E-6) => ??

sqrt([4,9,16]) ==> [2.0,3.0,4.0]
sqrt({4,9,16}) ==> {2.0,3.0,4.0}

sqrt({[4,9,16],[4,9,16],[4,9,16]}) ==> {[2.0,3.0,4.0],[2.0,3.0,4.0],[2.0,3.0,4.0]}