513
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Floating-point Math Instructions
3
FVAL
Example Programming
z Converting ASCII Text in Decimal Notation to Floating-point Data
When CIO 0.00 is ON in the following example, FVAL(449) converts the specified decimal-notation
ASCII text number in the source words starting at D0 to floating-point data and writes the result to
destination words D100 and D101.
z Converting ASCII Text in Scientific Notation
When CIO 0.00 is ON in the following example, FVAL(449) converts the specified scientific-notation
ASCII text number in the source words starting at D0 to floating-point data and writes the result to
destination words D100 and D101.
0000010011000000
1011111110011110
0.00
15 0
D100
D101
20 (Space)
31 (1)
32 (2)
34 (4)
32 (2)
00
2D (−)
30 (0)
2E (.)
33 (3)
35 (5)
31 (1)
D0
D1
D2
D3
D4
D5
− 01. 234521
0000010011000000
1011111110011110
15 0
FVAL
D0
D100
Conversion
Storage
Ignored
The 7th and higher digits are ignored.
(The sign, decimal point, and leading
zeroes/spaces are not counted.)
0100001010101111
1011110001001010
0.00
15 0
D100
D101
2E (.)
33 (3)
35 (5)
2D (−)
32 (2)
00
2D (−)
31 (1)
32 (2)
34 (4)
45 (E)
30 (0)
00
D0
D1
D2
D3
D4
D5
D6
−
0100001010101111
1011110001001010
15 0
FVAL
D0
D100
1. 2345E- 02
20 (Space)
Conversion
Storage
Ignored Ignored