anScript

Maths

mathLog2(&var a)

Calculate base-2 logarithm of a (a must be var.i or var.f).


mathSquareRoot(&var a)

Calculate square root of a (a must be var.i or var.f).


mathExpression(&var result, expression)

Calculate value of expression and assign it to result (all variables in expression must be either var.i supertype or var.f supertype). You can also use simpler syntax: result=expression

Remember that expression is not var! It’s simply math expression. Don’t use math expressions to simple assigments (e.g. a=4.i should be displaced by variableAssign(a, 4.i), a=a+4.i should be displaced by basicAddition(a, a, 4.i)). In math expression - should be only used as operator (e.g. a=-1.i+b is incorrect, a=4.i-(-8.i) is incorrect, a=0.i-1.i+b is correct).

mathExpression is considerably slow in comparison with basic operations.


operator &var result = expression

Execute mathExpression(result, expression).


mathGetRandomNumber(&var.i n)

Get random number.