# FANUC Series 16/18/160/180-Model C for Lathe Operator Manual

PROGRAMMING
16. CUSTOM MACRO
B–62754EN/01
287
Brackets are used to change the order of operations. Brackets can be used
to a depth of five levels including the brackets used to enclose a function.
When a depth of five levels is exceeded, alarm No. 118 occurs.
Example) #1=SIN [ [ [#2+#3] *#4 +#5] *#6] ;
(1)
(2)
(3)
(4)
(5)
(1) to (5) indicate the order of operations.
Brackets ([, ]) are used to enclose an expression. Note that parentheses
Errors may occur when operations are performed.
Table 16.3(b) Errors involved in operations
Operation
Average
error
Maximum
error
Type of error
a = b*c 1.55×10
–10
4.66×10
–10
a = b / c 4.66×10
–10
1.88×10
–9
1.24×10
–9
3.73×10
–9
a = b + c
a = b – c
2.33×10
–10
5.32×10
–10
a = SIN [ b ]
a = COS [ b ]
5.0×10
–9
1.0×10
–8
a = ATAN [ b ] / [ c ] (*4) 1.8×10
–6
3.6×10
–6
NOTE
1 The relative error depends on the result of the operation.
2 Smaller of the two types of errors is used.
3 The absolute error is constant, regardless of the result of the
operation.
4 Function TAN performs SIN/COS.
D Bracket nesting

D Brackets
D Operation error
a + b
Ǹ
Relative error(*1)
ε
b
Min
(*2)
ε
b
ε
c
ε
Absolute error(*3)
degrees