578
Special Math Instructions Section 3-14
Flags
Precautions The actual result for SIN(90
°) and COS(0°) is 1, but 9999 (0.9999) will be out-
put to R.
An error will occur if C is a constant greater than 0001.
An error will occur if linear extrapolation is specified but the X coordinates are
not in ascending order (X
1
< X
2
< ... < X
n
< S< X
n+1
).
An error will occur if linear extrapolation is specified and BCD input is speci-
fied (bit 15 of C ON) but S is not BCD.
An error will occur if a trigonometric function is specified (C=0000 or 0001) but
S is not BCD between 0000 and 0900.
Examples Sine Function (C: #0000)
The following example shows APR(069) used to calculate the sine of 30
°.
Cosine Function (C: #0001)
The following example shows APR(069) used to calculate the cosine of 30
°.
(SIN(30) = 0.8660)
Name Label Operation
Error Flag ER ON if C is a constant greater than 0001.
ON if C is a word address but the X coordinates are not in
ascending order (X
1
≤ X
2
≤ ... ≤ X
m
).
ON if C is a word address and bits 9, 11, and 15 of C indi-
cate BCD input, but S is not BCD.
ON if C is a word address and bit 9 of C indicates floating-
point data, but S is a one-word constant.
ON if C is 0000 or 0001 but S is not BCD between 0000
and 0900.
OFF in all other cases.
Equals Flag = ON if the result is 0000.
OFF in all other cases.
Negative Flag N ON if bit 15 of R is ON.
OFF in all other cases.
S: D00000 R: D00100
0 10
1
10
0
10
–1
10
–1
10
–2
10
–3
10
–4
0 3 0 0 5 0 0 0
Source data Result
Set the source data in 10
–1
degrees.
(0000 to 0900, BCD)
Result data has four significant digits,
fifth and higher digits are ignored.
(0000 to 9999, BCD)
S: D00010 R: D00200
0 10
1
10
0
10
–1
10
–1
10
–2
10
–3
10
–4
0 3 0 0 8 6 6 0
Source data Result
Set the source data in 10
–1
degrees.
(0000 to 0900, BCD)
Result data has four significant digits,
fifth and higher digits are ignored.
(0000 to 9999, BCD)