Fundamental Principles of NC Programming
2.2 Language elements of the programming language
Fundamentals
2-12 Programming Manual, 10.2004 Edition, 6FC5 298-7AB00-0BP1
Operators/mathematical functions
Operators and
mathematical
functions
Meaning
+ Addition
- Subtraction
* Multiplication
/ Division
Notice!: (type INT)/(type INT)=(type REAL); e.g., 3/4 = 0.75
DIV Division, for variable types INT and REAL
Notice!: (type INT)DIV(type INT)=(type INT); e.g., 3 DIV 4 = 0
MOD Modulo division (INT type only) produces the remainder of INT division, e.g.,
3 MOD 4=3
: Chain operator (for FRAME variables)
Sin() Sine
COS() Cosine
TAN() Tangent
ASIN() Arcsine
ACOS() Arccosine
ATAN2() Arctangent2
SQRT() Square root
ABS() Absolute number
POT() 2nd power (square)
TRUNC() Truncate to integer
ROUND() Round to integer
LN() Natural logarithm
EXP() Exponential function
Comparison and logic operators
Comparison and logic
operators
Meaning
== Equal to
<> Not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
AND AND
OR OR
NOT Negation
XOR Exclusive OR