.Rules
and functions
Rules
1.Only the following symbols are allowed: ( ), +,
-, *, /
2 All named variables must have
parentheses "()". (except x and y)
for example, pi or e or φ
are not allowed; use pi() and exp() and phi() instead.
3 .Shorthand notation such as 2x, 3cos(b) is not
allowed; use asterisks (*). For example, 2 * x, 3 * cos(), etc.
4.'%' is not allowed; use mod(a,b).
5.'^' is not allowed; use pow(a,b).
Build-in functions
.abs(x): absolute value
.acos(x): arc cosine
.asin:(x) arc sine
.atan(x): arc tangent
.atan2(x,y): Returns the angle theta from the conversion of
rectangular coordinates (y, x) to polar coordinates (r, theta).
x - the ordinate coordinate
y - the abscissa coordinate
.avg(a,b,...): average
.cbrt(x): cubic root
.ceil(x): nearest upper integer
.cos(x): cosine
.cosh(x): hyperbolic cosine
.cot(x): cotangent
.csc(x): cosecan
.exp(): e, Euler's number
(=2.718281...)
.exp(x): euler's number raised
to the power (e^x)
.floor(x): nearest lower
integer
.log(x): logarithmus naturalis
(base e),log(e)=1
.log10(x): logarithm (base 10)
.log2(x): logarithm (base 2),
log2(x)=log(x)/log(2)=log10(x)/log10(2)
.max(a,b,...): mazimum
.min(a,b,...): minimum
.mod(x,y): Remainder, mod(3,2)
= 3 % 2 = 1
.phi(): φ, golden ratio,
(=1.6180339887....)
.pi(): π, PI, (=3.14159...)
.pow(x,y): power, pow(2,3) = 2
* 2 * 2 = 8
.random(): random value, 0 ~
1.0
.random(x,y): random value, x
~ y
.round(x): rounding
.sec(x): secant
.sin(x): sine
.signum(x): signum function
.sinh(x): hyperbolic sine
.sqrt(x): square root
.tan(x): tangent
.tanh(x): hyperbolic tangent
.todegrees(x): Converts an angle measured in radians to an
approximately equivalent angle measured in degrees.
.toradians(x): Converts an angle measured in degrees to an
approximately equivalent angle measured in radians.
|
|
.Examples:
Examples
.a=2*17.41+pow((12*2),(0-1)) = 34.86167
.a=pow(exp(),2) -
2 * pi() =1.10587
.a=3 * sin(y) - 2
/ (x - 2) = 2.07555 (where "x"=0.5d,"y"=0.25d )
.a=3 * sin(y+x) - 2 / (x -
2) = 3.37825 (where "x"=0.5d,"y"=0.25d )
.a=-3 * x + 2 / exp()+ y*pi()+
4/phi()
= -3 * 0.5 + 2 / 2.718281 + 0.25* 3.14159+ 4/1.61803398874
= 2.49329 (where "x"=0.5d,"y"=0.25d )
.a=2 * cos(x * y)=1.9844
(where "x"=0.5d,"y"=0.25d
)
.a=8+avg(1,2,3,4,5)-min(1,2,3,4,5)
=10
.a=-8.9-pow(pow(2,2),pow(2,1))
= -24.9
|
|