Math Object

Navigation:  Widget Designer > Scripting > Object and Member Notation (dot syntax) >

Math Object

prev main next

Navigation:  Widget Designer > Scripting > Object and Member Notation (dot syntax) >

Math Object

prev main next

Please wait. Due to its content this page might take a while to load...

The Math object offers a wide variety of mathematical functions. It always returns the computed result as a numeric value without changing the argument itself.

Find here a list of all available methods. Remember to assign a suiting type to the variable for the result, e.g. "Double". In the interests of clarity, the result is rounded to two digits.

Description and Syntax

Result

Abs returns the absolute value of a specified number.

varRes = Math.Abs(-1.23)

 

Acos returns the angle whose cosine is the specified number (in radians!).

varRes = Math.Acos(0.99)

 

Asin returns the angle whose sine is the specified number (in radians!).

varRes = Math.Asin(0.99)

 

Atan returns the angle whose tangent is the specified number (in radians!).

varRes = Math.Atan(0.99)

 

Ceiling returns the smallest integer greater than or equal to the specified number.

varRes = Math.Ceiling(1.5)

 

Cos returns the cosine of the specified angle (in radians!).

varRes = Math.Cos(30)

 

Exp returns e raised to the specified power.

varRes = Math.Exp(1)

 

Floor returns the largest integer less than or equal to the specified number.

varRes = Math.Floor(1.5)

 

Log returns the natural logarithm of a specified number.

varRes = Math.Log(2.718)

 

Log10 returns the base 10 logarithm of a specified number.

varRes = Math.Log10(5)

 

Max returns the larger of two specified numbers.

varRes = Math.Max(1, 2)

 

Min returns the smaller of two numbers.

varRes = Math.Min(3, 4)

 

Mod returns the remainder after the division of one number by another.

varRes = Math.Mod(10, 3)

 

Pow returns a specified number raised to the specified power.

varRes = Math.Pow(5, 2)

 

Returns a random integer value between the indicated min and max value

varRes = Math.Random(0, 100)

 

Round rounds a value to the nearest integer or specified number of decimal places.

varRes = Math.Round(1.234, 2)

 

Sign returns a value indicating the sign of a number.

varRes = Math.Sign(-10)

 

Sin returns the sine of the specified angle (in radians!).

varRes = Math.Sin(30)

 

Sqrt returns the square root of a specified number.

varRes = Math.Sqrt(25)

 

Tan returns the tangent of the specified angle (in radians!).

varRes = Math.Tan(30)

 

Truncate calculates the integral part of a number.

varRes = Math.Truncate(10.73)

 

 

1.23

 

 

 

0.14

 

 

 

1.43

 

 

 

0.78

 

 

 

2

 

 

 

0,15

 

 

2.72

 

 

 

1

 

 

 

0.99

 

 

 

0.7

 

 

 

2

 

 

3

 

 

 

1

 

 

 

25

 

 

 

42

 

 

 

1.23

 

 

 

-1

 

 

 

-0.99

 

 

 

5

 

 

 

-6.41

 

 

 

10