Convert Floating-Point to Decimal Form (CVTFPDF)

Instruction Syntax

Op Code (Hex) Operand 1 Operand 2 Operand 3
CVTFPDF 10BF Decimal exponent Decimal significand Source
CVTFPDFR 12BF Decimal exponent Decimal significand Source
Operand 1: Packed variable scalar or zoned variable scalar (1 to 31 digits).

Operand 2: Packed variable scalar or zoned variable scalar (1 to 31 digits).

Operand 3: Floating-point scalar.

Description:

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.

Limitations (Subject to Change)

The following are limits that apply to the functions performed by this instruction.

  • The result of the operation is unpredictable for any type of overlap between the decimal exponent and decimal significand operands.

Authorization Required

  • None

Lock Enforcement

  • None

Exceptions

  • 06 Addressing
    • 0601 Space Addressing Violation
    • 0602 Boundary Alignment
    • 0603 Range
  • 08 Argument/Parameter
    • 0801 Parameter Reference Violation
  • 0C Computation
    • 0C0D Floating-Point Inexact Result
  • 10 Damage Encountered
    • 1004 System Object Damage State
    • 1044 Partial System Object Damage
  • 1C Machine-Dependent
    • 1C03 Machine Storage Limit Exceeded
  • 20 Machine Support
    • 2002 Machine Check
    • 2003 Function Check
  • 22 Object Access
    • 2201 Object Not Found
    • 2202 Object Destroyed
    • 2203 Object Suspended
    • 2208 Object Compressed
    • 220B Object Not Available
  • 24 Pointer Specification
    • 2401 Pointer Does Not Exist
    • 2402 Pointer Type Invalid
  • 2E Resource Control Limit
    • 2E01 User Profile Storage Limit Exceeded
  • 32 Scalar Specification
    • 3201 Scalar Type Invalid
  • 36 Space Management
    • 3601 Space Extension/Truncation
  • 44 Protection Violation
    • 4401 Object Domain or Hardware Storage Protection Violation
    • 4402 Literal Values Cannot Be Changed