Parent Topic: Language
Examples of arithmetic expressions are:
10.3
sin(%3) * 27.05 - (2+ln(#temp))
min(%1,%2,%3) * and(%6,15)
'-x' negation
'^' exponentiation
'/' division
'*' multiplication
'+' addition
'-' subtraction
'()' parenthesis
sin (e) sine
cos (e) cosine
tan (e) tangent
asin (e) arc sine
acos (e) arc cosine
atan (e) arc tangent
deg (e) radians to degrees
rad (e) degrees to radians
ln (e) natural logarithm
exp (e) natural exponent
log10 (e) base 10 logarithm
exp10 (e) base 10 exponent
int (e) integer part of real
frac (e) fraction part of real
abs (e) absolute value
where:
e can be any arithmetic expression.
Arguments for trigonometric functions MUST be expressed
in radians.
example:
int(tan(2.3 * ln(%6)))
atan2 (v1,v2) arc tan (v1/v2) using signs of v1,v2
mod (v1,v2) remainder of v1/v2
min (v1,v2,...,vn) minimum value of v1,v2,...,vn
max (v1,v2,...,vn) maximum value of v1,v2,...,vn
where
v1,v2,...,vn are arithmetic elements, excluding
attribute variables.
example:
min (%1, %2, #temp, 25.5, @dbx)
not (v1) logical not
and (v1,v2,...,vn) logical and
or (v1,v2,...,vn) logical inclusive or
xor (v1,v2,...,vn) logical exclusive or
where
v1,v2,...,vn are arithmetic elements, excluding
attribute variables.
example:
#t = not(%1); #t= and(#t,255); | to ensure only 8 bits