
124
Program Configuration
Section 7-4
Floating Point Constants
These are positive or negative numbers that are expressed in exponential for-
mat. E (single-precision) or D (double-precision) is entered after the mantissa,
and then the exponent is entered.
Example:
For the value 12,300,000, the following equations apply.
= 1.23
×
10,000,000
= 1.23
×
10
7
= 1.23E + 7 (single-precision)
= 1.23D + 7 (double-precision)
1.23 is the mantissa and E + 7 or D + 7 is the exponent.
Single Precision
This type of constant is stored with seven-digit precision and is output as a
six-digit constant with the seventh digit rounded off within the range of
±
1.2
×
10
–38
to
±
3.4
×
10
–38
. It is represented by one of the following methods:
• As a number with six or fewer digits:
1234.5
• As a number in exponential form using E:
–1.2E+3
• As a number with the character “!” at the end: 2.34!
Double Precision
This type of constant is stored with 16-digit precision and is output with up to
15 digits or less with the 16th digit rounded off within the range of
±
2.23
×
10
–
308
to
±
1.79
×
10
–308
. It is represented by one of the following methods:
• As a number with seven or more valid digits:
1.23456789
• As a number in exponential form using D:
–1.2D–3
• As a number with the character “#” at the end: 2.34#
Note
Precautions on Real Numbers:
A real number expressed in the floating point format is advantageous in allow-
ing a wide range of numbers to be handled. However, not all numbers are
necessarily expressed correctly due to the nature of the binary expression
and as a result, some of them are expressed in approximate values. There-
fore, most of the values and calculation results stored in memory contain
some amount of error. Although this error is normally so small that it cannot
cause any problem, it may be interpreted as a large error depending on the
application.
For example, when the number is truncated below the decimal point after mul-
tiplying “0.1” by 10, the result of “1” will be expected. However, “0.1” is stored
in the memory as an approximate value of “0.0999...” because it cannot be
expressed in the binary format. When this value of “0.0999...” is multiplied by
10, the result will be “0.999...” When the number is truncated below the deci-
mal point, the result will be “0”.
The solutions to this problem vary depending on the application. When
reviewing design proposals, check if a desired operation can be achieved by
using the integer type or if desired integers can be obtained by rounding the
calculation results.
Summary of Contents for C200H-ASC11
Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Page 2: ...iv...
Page 4: ...vi...