Skip to content

Maths functions

FastStats supports the following mathematical functions:

Log

Log base 10

Expression
Log([Value])

Examples:

  • Log(100) = 2
  • Log(1000) = 3

Abs

Absolute Valu

Expression
Abs([Value])

Examples:

  • Abs(123.45) = 123.45
  • Abs(-123.45) = 123.45

Sqrt

Square Root

Expression
Sqrt([Value])

Examples:

  • Sqrt(4) = 2
  • Sqrt(64) = 8

Ceil

Round up

Expression
Ceil([Value])

Examples:

  • Ceil(123.1) = 124
  • Ceil(123.9) = 124

Floor

Round down

Expression
Floor([Value])

Examples:

  • Floor(123.1) = 123
  • Floor(123.9) = 123

Ln

Natural log

Expression
Ln([Value])

Exp

Exponential

Expression
Exp([Value])

RoundUp

Round Up to specified precision.

Expression
RoundUp([Value],[Precision])

For example, RoundUp(123,10) rounds up to the next 10, i.e. 130.

RoundDown

Round Down to specified precision.

Expression
RoundDown([Value],[Precision])

For example, RoundDown(123,10) rounds down to the next 10, i.e. 120.

Round

Round off to specified precision.

Expression
Round([value])
Expression
Round([Value],[Precision])

For example, Round(x) rounds x off to the nearest integer. Round(123,10) rounds off to the nearest 10, i.e. 120.

Rand

Returns a random number between 0 and its argument, or 0 and 1 if no argument is given.

Expression
Rand([Value])

Power

Power

Expression
Power(x,y)

For example, Calculates x to the power of y. Power(x,y) is equivalent to x ^ y. Power(3,2) = 3 ^ 2 = 9

SequenceNumber

Returns a new number for each record processed.

Expression
SequenceNumber(1)

When used on a Data Grid the first row will show 1, the second row will show 2 and so on. Useful when having to create a unique row number to otherwise unidentified data

DecToHex

Allows you to convert decimal numbers into hexadecimal strings.

For example, DecToHex(666) will return the hexadecimal result of 29A.

HexToDec

Allows you to convert hexadecimal strings into decimal numbers.

For example, HexToDec(“29A”) will return the decimal number 666

Trigonometry functions

A group of 9 functions cover basic, inverse and hyperbolic trigonometry:

  • Basic - Sin(n), Cos(n), Tan(n)
  • Inverse - ASin(n), ACos(n), ATan(n)
  • Hyperbolic - Sinh(n), Cosh(n), Tanh(n)

More details on these functions can be found on the Wikipedia website: