Maths functions
FastStats supports the following mathematical functions:
Log¶
Log base 10
Examples:
Log(100)= 2Log(1000)= 3
Abs¶
Absolute Valu
Examples:
Abs(123.45)= 123.45Abs(-123.45)= 123.45
Sqrt¶
Square Root
Examples:
Sqrt(4)= 2Sqrt(64)= 8
Ceil¶
Round up
Examples:
Ceil(123.1)= 124Ceil(123.9)= 124
Floor¶
Round down
Examples:
Floor(123.1)= 123Floor(123.9)= 123
Ln¶
Natural log
Exp¶
Exponential
RoundUp¶
Round Up to specified precision.
For example, RoundUp(123,10) rounds up to the next 10, i.e. 130.
RoundDown¶
Round Down to specified precision.
For example, RoundDown(123,10) rounds down to the next 10, i.e. 120.
Round¶
Round off to specified 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.
Power¶
Power
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.
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:
- https://en.wikipedia.org/wiki/Trigonometric_functions
- https://en.wikipedia.org/wiki/Inverse_trigonometric_functions
- https://en.wikipedia.org/wiki/Hyperbolic_function