Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
18 Applied Instructions (Floating Point)
18.4 DESTR / Floating Point to Character String Conversion
449
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
11
Applied Instructions
(Data Operation)
12
Applied Instructions
(High Speed
Processing)
13
Applied Instructions
(Handy
Instruction)
14
Applied Instructions
(External FX I/O
Device)
15
Applied Instructions
(External Device
(optional device))
16
Applied Instructions
(External Device)
17
Applied Instructions
(Data Transfer 2)
18
Applied Instructions
(Floating Point)
19
Applied Instructions
(Data Operation 2)
20
Applied Instructions
(Positioning
Control)
For example, in the case of all digits of 8 and decimal digits of 3, when -1.23456 is specified, the data after
is stored as follows.
The converted character string data is stored in the device after as follows.
- For the sign, "20H" (space) is stored when the binary floating decimal point data is positive, and
"2DH" (-) is stored when negative.
- When the decimal part of binary floating decimal point data does not settle within the decimal digits, the
lower decimal digits are rounded off.
- When the number of decimal digits is set in other than "0", automatically "2EH" (.) is stored at the
specified decimal digits + 1 digit.
However, when the number of decimal digits is "0", "2EH" (.) is not stored.
- When the number of digits subtracting the sign, decimal point, and decimal part from the total number of
digits is greater than the integer part of the binary floating decimal point data, "20H" (space) is inserted
between the sign and the integer part.
- "00H" or "0000H" is automatically stored at the end of the converted character string.
0
8
3
1 2 3 5
Sign
+1
+2
20H(space)
31H(1)
0000H
b15
+1
+2
+3
+4
b8 b7 b0
To be stored automatically at the end of character string.
32H(2)
35H(5)
2DH(-)
20H(space)
2EH(.)
33H(3)
+1
Binary floating decimal point (real number)
-1.23456
All digits
Number of digits
below decimal point
d
s1
s2
d
d
d
d
s1
s2
s2
1 2 3
Number of digits
below decimal point
0: Decimal point type
8 (All digits)
2 (Number of digits
below decimal point)
+1
+2
All digits
456
Rounded off.
+1
-1.23456
s1
s2
s1
s2
s2
1 2 3
Number of digits below decimal point
0: Decimal point type
8 (All digits)
2 (Number of digits
below decimal point)
+1
+2
All digits
Added automatically.
+1
-1.23456
s1
s2
s1
s2
s2
1 2 3
Number of digits below decimal point
0
8
2
+1
+2
All digits
"20H" (space) is inserted.
+1
-1.23456
s1
s2
s1
s2
s2