Mitsubishi Electronics 13JW55 Manuel D’Utilisation
App. - 44
Project name
QA-14
Program name
MAIN
Appendix 4.26 Example of operation program calculating square root of data
The data stored in D5 is calculated to its square root and the result is stored in D6
and D7.
X0
0
D6
D5
BSQR
K4Y50
D7
MOVP
Sets data
D5
K4X20
MOVP
K4Y60
D6
MOVP
Square root
operation
Square root
Square root
(integral part)
Square root
Square root
(decimal part)
D5
D6
D7
=
0 to 9999
(BCD value)
0 to 9999
(BCD value)
0 to 9999
(BCD value)
Results of square root operation are stored as follows.
Integral part Decimal part
A value in 5th decimal digit is rounded off.
Therefore, a value in 4th decimal place
has error of ±1.
Therefore, a value in 4th decimal place
has error of ±1.
REMARK
QCPUs provide square root operation instructions for data in a real number
(floating point) format.
(floating point) format.