Assignment Expression
The place where numbers can be used after all address symbols can be substituted by assignment expression.
Format
Characters like space, tab and enter in the middle of expression are not allowed. And the expression must be ended with valid separator.
An assignment expression begins with an equal mark, followed by an arithmetic expression which is constituted by various operators, functions, variables, brackets, etc.
Table for assignment expression is as follows:
Category | Operation | Symbol | ||
---|---|---|---|---|
Logic Operation | or | |||
and | && | |||
not | ! | |||
Relational Operation | equal to | == | ||
not equal to | != | |||
greater than | > | |||
less than | < | |||
Arithmetic Operation | addition | + | ||
subtraction | - | |||
multiplication | * | |||
division | / | |||
Function | sine | sin | ||
cosine | cos | |||
tangent | tg | |||
cotangent | ctg | |||
absolute | abs | |||
exponent | exp | |||
square root | sqrt | |||
natural logarithm | log | |||
arcsine | asin | |||
arc cosine | acos | |||
arc tangent | atg | |||
round-down | int | |||
Bracket | ( ) | It decides the calculation sequence. (Expression in the bracket will be calculated at first.) |
CAUTION:
Bracket after sin,cos,tg,ctg,asin,acos,atg means radian, eg. 5 in sin(5) means 5 radians.
Programming Example
Example 1:
B=1+2; 'i.e. B=3
Example 2:
G00 X3 Y5 Z=5+sin (5+abs (-8)); 'Assign 5+sin (5+abs (-8)) to Z
Example 3
#1=4+log6 G01 X2 Y=#1 'Assign 4+log6 to Y