Previous Topic Next topic Print topic


Output Conversion

For E-Format output conversion, an arithmetic or string value from a PUT statement's list is converted to a floating-point decimal value and placed, right-justified, in a field of w blanks.

The result field contains a minus sign if the value is negative, followed by the most significant digit of the mantissa, followed by a decimal point, followed by d digits of the mantissa (if d is omitted, it is taken to be p-1), followed by the letter E, followed by the sign of the exponent, followed by n exponent digits, where n is an implementation defined constant. For the maximum precision allowed by Open PL/I, see your Open PL/I User's Guide.

If the value and its sign cannot fit in w characters, the ERROR condition is signaled.

The following results are produced by both forms of the E-format.

Value Format     Field
0 E(10,3) 0.000E+000
-15 E(10,3) -1.500E+001
12345678     E(10,3) 1.234E+0 07
7.3E-10 E(10,3) 7.300E-010
0 E(14) boxes0.000000 E+000
-25 E(14) boxes-2.500000E+001

The last two examples assume that the precision of the value to be converted is 7, giving a default value of 6 for d.

Previous Topic Next topic Print topic