Skip to content
AndreasBurbach edited this page Dec 13, 2021 · 2 revisions

Documentation of Syntax

General calculations

Addition of two values:

1 + 2 or x + y

Subtraction of two values:

1 - 2 or x - y

Multiplication of two values:

1 * 2 or x * y

Division of two values:

1 / 2 or x / y

Integer division of two values:

1 // 2 or x // y

Modulo of a value:

5 % 2 or x % y

Power of a value:

3 ** 2 or x ** y

Negatiation of a number value:

-5 or -x

Factorial of a number value:

!5

Bit-Operations

Bitwise Not

~5 or ~x

Bit-Shift left

5 << 2

Bit-Shift right

4 >> 2

Bit-Or

4 | 2

Bit-And

4 & 2

Boolean Operations

Boolean And

true && false

Boolean Or

true || false

Boolean XOr

true ^ false

Boolean equal

5 == 4

Boolean equal ignore case

"abc" =i "ABC"

Boolean not equal

5 != 4

Boolean not equal ignore case

"abc" !=i "ABC"

Boolean lower

5 < 4

Boolean lower equal

5 <= 4

Boolean upper

5 > 4

Boolean upper equal

5 >= 4

Boolean not

not true

Boolean array or string contains value

"a" in "array"

1 in [1,2,3]

Boolean array or string not contains value

"a" not in "array"

1 not in [1,2,3]

Constants

Math constants

Euler Number: e

Pi: pi

DateTime constants

Current date and time: DateTime.Now*

Default Math Functions

Returns the absolute value of a number.

Abs(number) Abs(Array<number>)

Example:

Abs(-1) => 1

Abs(2) => 2

Abs([-3,4]) => [3,4]

Returns the angle whose cosine is the specified number.

ACos(number) ACos(Array<number>)

Example:

ACos(0) => 1

ACos([0, 0.5]) => [1, 1.04719755]

Returns the angle whose hyperbolic cosine is the specified number.

ACosH(number) ACosH(Array<number>)

Example:

ACosH(1) => 0

ACosH([1,2]) => [0, 1.316...]

Returns the angle whose sine is the specified number.

ASin(number) ASin(Array<number>)

Example:

ASin(0) => 0

ASin([0, 0.5]) => [0, 0.5235...]

Returns the angle whose hyperbolic sine is the specified number.

ASinH(number) ASinH(Array<number>)

Example:

ASinH(0) => 0

ASinH([0, 1]) => [0, 0.8813...]

Returns the angle whose tangent is the specified number.

ATan(number) ATan(Array<number>)

Example:

ATan(0) => 0

ATan([0, 1]) => [0, 0.7853...]

Returns the angle whose tangent is the quotient of two specified numbers.

ATan2(number, number) ATan2(Array<number>, number) ATan2(number, Array<number>) ATan2(Array<number>, Array<number>)

Example:

ATan2(1, 1) => 0.78539816339744828

ATan2(Array<number>, number) =>

ATan2(number, Array<number>) =>

ATan2(Array<number>, Array<number>) =>

Returns the angle whose hyperbolic tangent is the specified number.

ATanH(number) ATanH(Array<number>)

Example:

ATanH(0.5) => 0.54930614433405489

ATanH(Array<number>) =>

Returns the cube root of a specified number.

Cbrt(number) Cbrt(Array<number>)

Example:

Cbrt(27) => 3

Cbrt(Array<number>) =>

Returns the cosine of the specified angle.

Cos(number) Cos(Array<number>)

Example:

Cos(1) => 0.54030230586813977

Cos(Array<number>) =>

Returns the hyperbolic cosine of the specified angle.

CosH(number) CosH(Array<number>)

Example:

CosH(1) => 1.5430806348152437

CosH(Array<number>) =>

Returns the smallest integral value that is greater than or equal to the specified decimal number.

Ceilling(number) Ceilling(Array<number>)

Example:

Ceilling(1.1) => 2.0

Ceilling(Array<number>) =>

Returns value clamped to the inclusive range of min and max.

Clamp(number, number, number) Clamp(Array<number>, number, number) Clamp(number, Array<number>, number) Clamp(number, number, Array<number>) Clamp(Array<number>, Array<number>, number) Clamp(number, Array<number>, Array<number>) Clamp(Array<number>, Array<number>, Array<number>)

Example:

Clamp(1, 10, 20) => 10

Clamp(number, number, number) =>

Clamp(number, number, number) =>

Clamp(number, number, number) =>

Clamp(number, number, number) =>

Clamp(number, number, number) =>

Clamp(number, number, number) =>

CrossSum(number) CrossSum(Array<number>)

Example:

CrossSum(1800) => 9

CrossSum(number) =>

Returns e raised to the specified power.

Exp(number) Exp(Array<number>)

Example:

Exp(2) => 7.38905609893065

Exp(number) =>

Returns the largest integral value less than or equal to the specified decimal number.

Floor(number) Floor(Array<number>)

Example:

Floor(1.1) => 1.0

Floor(number) =>

Returns the natural (base e) logarithm of a specified number.

Log(number, number) Log(Array<number>, number) Log(number, Array<number>) Log(Array<number>, Array<number>)

Example:

Log(12, 2) => 3.5849625007211561

Log(number, number) =>

Log(number, number) =>

Log(number, number) =>

Returns the base 2 logarithm of a specified number.

Log2(number) Log2(Array<number>)

Example:

Log2(12) => 3.5849625007211561

Log2(number) =>

Returns the base 10 logarithm of a specified number.

Log10(number) Log10(Array<number>)

Example:

Log10(12) => 1.0791812460476249

Log10(number) =>

Returns the larger of two or more decimal numbers.

Max(Array<number>) Max(number, number)

Example:

Max(Array<number>) =>

Max(2, 3) => 3

Returns the smaller of two or more decimal numbers.

Min(Array<number>) Min(number, number)

Example:

Min(Array<number>) =>

Min(2, 3) => 2

Returns a specified number raised to the specified power.

Pow(number, number) Pow(Array<number>, number) Pow(number, Array<number>) Pow(Array<number>, Array<number>)

Example:

Pow(3, 2) => 9

Pow(number, number) =>

Pow(number, number) =>

Pow(number, number) =>

Rounds a decimal value to the nearest integral value, and rounds midpoint values to the nearest even number.

Round(number) Round(Array<number>)

Example:

Round(2.2) => 2.0

Round(number) =>

Rounds a decimal value to a specified number of fractional digits, and rounds midpoint values to the nearest even number.

Round(number, number) Round(Array<number>, number) Round(number, Array<number>) Round(Array<number>, Array<number>)

Example:

Round(2.234, 2) => 2.23

Round(number, number) =>

Round(number, number) =>

Round(number, number) =>

Root(number, number) Root(Array<number>, number) Root(number, Array<number>) Root(Array<number>, Array<number>)

Example:

Root(9, 2) => 3

Root(number, number) =>

Root(number, number) =>

Root(number, number) =>

Returns the sine of the specified angle.

Sin(number) Sin(Array<number>)

Example:

Sin(1) => 0.8414709848078965

Sin(number) =>

Returns the hyperbolic sine of the specified angle.

SinH(number) SinH(Array<number>)

Example:

SinH(1) => 1.1752011936438014

SinH(number) =>

Returns the square root of a specified number.

Sqrt(number) Sqrt(Array<number>)

Example:

Sqrt(16) => 4

Sqrt(number) =>

Returns the tangent of the specified angle.

Tan(number) Tan(Array<number>)

Example:

Tan(1) => 1.5574077246549023

Tan(number) =>

Returns the hyperbolic tangent of the specified angle.

TanH(number) TanH(Array<number>)

Example:

TanH(1) => 0.76159415595576485

TanH(number) =>

Calculates the integral part of a specified decimal number.

Truncate(number) Truncate(Array<number>)

Example:

Truncate(1.234) => 1

Truncate(number) =>

Computes the p-Norm.

Norm(Array<number>, number)

Example:

Norm(Array<number>, number) =>

Calculates the L2 norm of the vector, also known as Euclidean norm.

EulerNorm(Array<number>)

Example:

EulerNorm(Array<number>) =>

Calculates the infinity norm of the vector.

MaxNorm(Array<number>)

Example:

MaxNorm(Array<number>) =>

Returns the greatest common divisor ( gcd ) of two integers using Euclid's algorithm.

Gcd(number, number) Gcd(Array<number>, number) Gcd(number, Array<number>) Gcd(Array<number>, Array<number>)

Example:

Gcd(10, 5) => 5

Gcd(number, number) =>

Gcd(number, number) =>

Gcd(number, number) =>

Returns the least common multiple ( lcm ) of two integers using Euclid's algorithm.

Lcm(number, number) Lcm(Array<number>, number) Lcm(number, Array<number>) Lcm(Array<number>, Array<number>)

Example:

Lcm(10, 5) => 10

Lcm(number, number) =>

Lcm(number, number) =>

Lcm(number, number) =>

Computes the dot product between two vectors.

DotProduct(Array<number>, Array<number>)

Example:

DotProduct(Array<number>, Array<number>) =>

Computes the binomial coefficient: n choose k.

Binomial(number, number) Binomial(Array<number>, number) Binomial(number, Array<number>) Binomial(Array<number>, Array<number>)

Example:

Binomial(3, 2) => 3

Binomial(number, number) =>

Binomial(number, number) =>

Binomial(number, number) =>

Trigonometric principal Arc Cotangent in radian

ACot(number) ACot(Array<number>)

Example:

ACot(1) => 0.78539816339744828

ACot(number) =>

Hyperbolic Area Cotangent

ACotH(number) ACotH(Array<number>)

Example:

ACotH(10) => 0.10033534773107562

ACotH(number) =>

Trigonometric principal Arc Cosecant of this Complex number.

ACsc(number) ACsc(Array<number>)

Example:

ACsc(1) => 1.5707963267948966

ACsc(number) =>

Hyperbolic Area Cosecant

ACscH(number) ACscH(Array<number>)

Example:

ACscH(1) => 0.88137358701954294

ACscH(number) =>

Trigonometric principal Arc Secant in radian

ASec(number) ASec(Array<number>)

Example:

ASec(1) => 0

ASec(number) =>

Hyperbolic Area Secant

ASecH(number) ASecH(Array<number>)

Example:

ASecH(1) => 0

ASecH(number) =>

Trigonometric Cotangent of an angle in radian, or adjacent / opposite. Reciprocal of the tangent.

Cot(number) Cot(Array<number>)

Example:

Cot(1) => 0.64209261593433065

Cot(number) =>

Hyperbolic Cotangent

CotH(number) CotH(Array<number>)

Example:

CotH(1) => 1.3130352854993312

CotH(number) =>

Trigonometric Cosecant of an angle in radian, or hypotenuse / opposite. Reciprocal of the sine.

Csc(number) Csc(Array<number>)

Example:

Csc(1) => 1.1883951057781212

Csc(number) =>

Hyperbolic Cosecant

CscH(number) CscH(Array<number>)

Example:

CscH(1) => 0.85091812823932156

CscH(number) =>

Trigonometric Secant of an angle in radian, or hypotenuse / adjacent. Reciprocal of the cosine.

Sec(number) Sec(Array<number>)

Example:

Sec(1) => 1.8508157176809255

Sec(number) =>

Hyperbolic Secant

SecH(number) SecH(Array<number>)

Example:

SecH(1) => 0.64805427366388546

SecH(number) =>

Statistic Math Functions

Estimates the unbiased population covariance from the provided samples. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN if data has less than two entries or if any entry is NaN.

CoVariance(Array<number>, Array<number>)

Example:

CoVariance(Array<number>, Array<number>) =>

Evaluates the sample mean, an estimate of the population mean. Returns NaN if data is empty or if any entry is NaN.

Mean(Array<number>)

Example:

Mean(Array<number>) =>

Estimates the sample median from the provided samples.

Median(Array<number>)

Example:

Median(Array<number>) =>

Computes the Pearson Product-Moment Correlation coefficient.

Pearson(Array<number>, Array<number>)

Example:

Pearson(Array<number>, Array<number>) =>

Estimates the tau-th quantile from the provided samples. The tau-th quantile is the data value where the cumulative distribution function crosses tau. Approximately median-unbiased regardless of the sample distribution.

Quantil(Array<number>, number)

Example:

Quantil(Array<number>, number) =>

Computes the Spearman Ranked Correlation coefficient.

Spearman(Array<number>, Array<number>)

Example:

Spearman(Array<number>, Array<number>) =>

Estimates the unbiased population standard deviation from the provided samples. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN if data has less than two entries or if any entry is NaN.

Std(Array<number>)

Example:

Std(Array<number>) =>

Estimates the unbiased population variance from the provided samples. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN if data has less than two entries or if any entry is NaN.

Variance(Array<number>)

Example:

Variance(Array<number>) =>

Default Functions

Concat(string, string) Concat(Array<object>, Array<object>)

Example:

Concat("a", "bc") => "abc"

Concat([1], [2,3]) => [1,2,3]

Count(string) Count(Array<object>)

Example:

Count("abc") => 3

Count([1,2]) => 2

Distinct(string) Distinct(Array<object>)

Example:

Distinct("abca") => "abc"

Distinct([1,2,3,1]) => [1,2,3]

Difference()

Example:

=>

HasDuplicates(string) HasDuplicates(Array<object>)

Example:

HasDuplicates("abca") => true

HasDuplicates([1,2,3,1]) => true

DateTime()

Example:

Except()

Example:

IndexOf()

Example:

Lower(string) Lower(Array<string>)

Example:

Upper("ABC") => "abc"

Upper(["A", "B"]) => ["a","b"]

Reverse(string) Reverse(Array<object>)

Example:

Reverse("abc") => "cba"

Reverse([1,2,3]) => [3,2,1]

Upper(string) Upper(Array<string>)

Example:

Upper("abc") => "ABC"

Upper(["a","b"]) => ["A", "B"]

HasAny(Array<object>)

Example:

HasAny([]) => false

HasAny([1,2]) => true

Sort(string) Sort(Array<object>)

Example:

Sort("acb") => "abc"

Sort([2,3,1]) => [1,2,3]

Trim(string) Trim(Array<object>)

Example:

Trim(" aa ") => "aa"

Trim(Array<object>) =>

Check Type Functions

IsString(object)

Example:

IsString(123) => false

IsNumber(object)

Example:

IsNumber("123") => false

IsBoolean(object)

Example:

IsBoolean(true) => true

IsDatetime(object)

Example:

IsDatetime(123) => false

IsArray(object)

Example:

IsArray([1,2]) => true

IsNull(object)

Example:

IsNull(123) => false

IsWhitespace(string)

Example:

IsWhitespace(" asda") => false

Converter Functions

ToNumber(object)

Example:

ToNumber("123") => 123

ToString(object)

Example:

ToString(123) => "123"

ToBoolean(object)

Example:

ToBoolean(1) => true

ToArray(object)

Example:

ToArray("Test") => ["T","e","s","t"]

Converts a degree (360-periodic) angle to a grad (400-periodic) angle.

DegreeToGrad(number) DegreeToGrad(Array<number>)

Example:

DegreeToGrad(number) =>

DegreeToGrad(Array<number>) =>

Converts a degree (360-periodic) angle to a radian (2*Pi-periodic) angle.

DegreeToRadian(number) DegreeToRadian(Array<number>)

Example:

DegreeToRadian(number) =>

DegreeToRadian(Array<number>) =>

Converts a grad (400-periodic) angle to a degree (360-periodic) angle.

GradToDegree(number) GradToDegree(Array<number>)

Example:

GradToDegree(number) =>

GradToDegree(Array<number>) =>

Converts a grad (400-periodic) angle to a radian (2*Pi-periodic) angle.

GradToRadian(number) GradToRadian(Array<number>)

Example:

GradToRadian(number) =>

GradToRadian(Array<number>) =>

Converts a radian (2*Pi-periodic) angle to a degree (360-periodic) angle.

RadianToDegree(number) RadianToDegree(Array<number>)

Example:

RadianToDegree(number) =>

RadianToDegree(Array<number>) =>

Converts a radian (2*Pi-periodic) angle to a grad (400-periodic) angle.

RadianToGrad(number) RadianToGrad(Array<number>)

Example:

RadianToGrad(number) =>

RadianToGrad(Array<number>) =>

Random functions

RndDecimal() RndDecimal(number) RndDecimal(number, number) RndDecimal(number, number, number)

Example:

RndDecimal() => A random integer number

RndDecimal(count) => An array with count of random integer numbers

RndDecimal(min, max) => A random integer number between min (including) and max (excluding)

RndDecimal(count, min, max) => An array with count of random integer numbers between min (including) and max (excluding)

RndInteger() RndInteger(number) RndInteger(number, number) RndInteger(number, number, number)

Example:

RndInteger() => A random decimal number

RndInteger(number) => An array with count of random decimal numbers

RndInteger(number, number) => A random decimal number between min (including) and max (excluding)

RndInteger(number, number, number) => An array with count of random decimal numbers between min (including) and max (excluding)

Array Creation

To create an array, just write the array like in javascript or python:

[1,2,3,4,5] creates an array with 1 to 5

Array Indexing/Slicing

The indexing and slicing of an array work nearly like in python:

array[2] => return the second element

array[-1] => returns the last element

For the next examples, the first argument is the "index" the second is the "count" and the third is the "step". The step can't be negative.

array[2:5] => returns an array with the second, third and fourth element

`array[1:6:2] => returns array with the first, third and fifth element

Credits

Some of the descriptions are from the Microsoft and Math.Net documentations, cause the functions based on their implementations.