This instruction converts a binary
floating-point value to a decimal form of a
floating-point value specified by a decimal exponent and
a decimal significand, and places the
result in the decimal exponent
and decimal significand operands.
The value of this number is considered to be as follows:
Value = S * (10**E)
where:
S =
The value of the decimal
significand operand.
E =
The value of the decimal
exponent operand.
*
Denotes multiplication.
**
Denotes exponentiation.
The decimal exponent must be specified as a decimal integer value. No
fractional digit positions
are allowed. It must be specified with at least five digit
positions. The decimal exponent
provides for containing a signed integer value specifying a
power of 10 which gives the
floating-point value its magnitude.
The decimal significand must be specified as a decimal value
with a single integer digit position
and optional fractional digit positions. The decimal
significand provides for containing a signed
decimal value specifying decimal digit which gives the
floating-point value its precision. The
decimal significand is formed as a normalized value, that
is, the leftmost digit position is
nonzero for a nonzero source value.
When the source contains a representation of a normalized
binary floating-point number with decimal
significand digits beyond the leftmost 7 digits for a short
floating-point source or beyond the
leftmost 15 digits for a long floating-point source, the
precision allowed for the binary
floating-point source is exceeded.
When the source contains a representation
of a denormalized binary
floating-point number, it may
provide less precision than the precision of a normalized
binary floating-point number, depending
on the particular source value. Decimal significand digits
exceeding the precision of the source
are set as a result of the conversion to provide for uniqueness
of conversion and are correct,
except for rounding errors. These digits are only as precise as the
floating-point calculations
that produced the source value. The floating-point inexact result (hex 0C0D) exception
provides a means of
detecting loss of precision in floating-point calculations.
The binary floating-point source is converted to a decimal
form floating-point value and rounded to
the precision of the decimal significand operand as follows:
The decimal
significand is formed as a normalized value and the decimal
exponent is set accordingly.
For the
nonround form of the instruction, the value to be assigned
to the decimal significand is adjusted
to the precision of the decimal significand, if necessary,
according to the current float rounding
mode in effect for the thread. For the optional round form
of the instruction, the decimal round
algorithm is used for the precision adjustment of the decimal
significand. The decimal round
algorithm overrides the current floating-point rounding mode
that is in effect for the thread.
Source values
which, in magnitude M, are in the range where (10**31-1) *
10**-31 <= M <=
(10**31-1) * 10**+31 are converted subject to the normal
rounding error defined for the
floating-point rounding modes and the optional round form
of the instruction.
Source values
which, in magnitude M, are in the range where (10**31-1) * 10**-31 > M >
(10**31-1) * 10**+31 are converted such that the rounding error
incurred on the conversion may
exceed that defined above. For round to nearest and the
optional round form of the instruction,
this error will not exceed by more than .47 units in the
least significant digit position of the
result, the error that would be incurred for a correctly
rounded result. For the other
floating-point rounding modes, this error will not exceed
1.47 units in the least significant digit
position of the result.
If necessary, the
decimal exponent value is adjusted to compensate for rounding.
The converted
and rounded value is then assigned
to the decimal exponent and decimal
significand operands.
A size (hex 0C0A) exception
cannot occur on the assignment of the decimal
exponent or the decimal significand values.