13. Program Support Functions
13.5 User Macro Specifications
354
Sequence of arithmetic operations
(1) The sequence of the arithmetic operations (1) through (3) is, respectively, the functions
followed by the multiplication arithmetic followed in turn by the addition arithmetic.
#101 = #111 + #112
∗
SIN[#113]
(1) Function
(2) Multiplication arithmetic
(3) Addition arithmetic
(2) The part to be given priority in the operation sequence should be enclosed in square
parentheses. Up to 5 pairs of such parentheses including those for the functions may be used.
#101 = SQRT [ [ [ #111 = #112 ]
∗
SIN[#113] + #114]
∗
#15] ;
First pair of parentheses
Second pair of parentheses
Third pair of parentheses
Examples of arithmetic commands
(1)
Main program
and argument
designation
G65 P100 A10 B20. ;
#101=100.000 #102=200.000 ;
#1
#2
#101
#102
10.000
20.000
100.000
200.000
(2)
Definition and
substitution
(=)
#1=1000
#2=1000.
#3=#101
#4=#102
#5=#10001 (#10001=-10.)
#1
#2
#3
#4
#5
1000.000
1000.000
100.000
200.000
−
10.000
···
From common variables
From compensation
amount
(3)
Addition and
subtraction
(+,
−
)
#11=#1+1000
#12=#2
−
50.
#13=#101+#1
#14=#10001
−
3. (#10001 = -10.)
#15=#10001+#102
#11
#12
#13
#14
#15
2000.000
950.000
1100.000
−
13.000
190.000
(4)
Multiplication
and division
(
∗
, /)
#21=100
∗
100
#22=100.
∗
100
#23=100
∗
100
#24=100.
∗
100.
#25=100/100
#26=100./100
#27=100/100.
#28=100./100.
#29=#10001
∗
#101
( #10001 = -10.)
#30=#10001/#102
#21
#22
#23
#24
#25
#26
#27
#28
#29
#30
10000.000
10000.000
10000.000
10000.000
1.000
1.000
1.000
1.000
−
1000.000
-0.050
(5)
Remainder
(MOD)
#19=48
#20=9
#31=#19 MOD #20
#19/#20 = 48/9 = 5 with 3 over
#31 = 3