Hexadecimal floating-point constants—E, EH, D, DH, L, LH, LQ

Floating-point constants let you introduce data that is in the form suitable for the operations of the floating-point feature instructions. These constants have the following advantages over fixed-point constants:

The nominal value can be a signed (see  1  in Table 1) integer, fraction, or mixed number (see  2  Table 1) followed by a signed exponent (see  3  in Table 1). If a sign is not specified for either the number or exponent, a plus sign is assumed.

If you specify the 'H' type extension you can also specify a rounding mode that is used when the nominal value is converted from decimal to its hexadecimal form. The syntax for nominal values (including the binary floating-point constants) is shown in Figure 1. The valid rounding mode values are:
Figure 1. Rounding mode values
1
Round by adding one in the first lost bit position
4
Unbiased round to nearest, with tie-breaking rule
5
Round towards zero (that is, truncate)
6
Round up towards the maximum positive value
7
Round down towards the minimum negative value
See  4  in Table 1.

The exponent must lie within the permissible range. If an exponent modifier is also specified, the algebraic sum of the exponent and the exponent modifier must lie within the permissible range.

Table 1. Hexadecimal floating-point constants
Subfield Value Example
1. Duplication factor Allowed  
2. Type E, D, and L  
3. Type Extension Omitted or H or Q  
4. Program type Allowed  
5. Modifiers    

   Length:

E-type:
1 to 8 (byte length)
.1 to .64 (bit length)
EH-type:
.12 to .64 (bit length)
 
D-type:
1 to 8 (byte length)
.1 to .64 (bit length)
DH-type:
.12 to .64 (bit length)
 
L-type:
1 to 16 (byte length)
.1 to .128 (bit length)
LH-type:
.12 to .128 (bit length)
LQ-type:
.12 to .128 (bit length)

 

      Implicit length:
      (Length modifier
      not present)

E-type: 4 bytes
D-type: 8 bytes
L-type: 16 bytes

 

      Alignment:
      (Length modifier
      not present)

E-type: Fullword
D-type: Doubleword
L-type: Doubleword
LQ-type: Quadword

 

   Scale:

E-type: 0 to 5
D-type: 0 to 13
L-type: 0 to 27

 

   Exponent:

-85 to +75  
6. Nominal value    

   Represented by:

 Decimal digits

E-type:
DC  E'+525'  1 
DC  E'5.25'  2 
 
D-type:
DC  D'-525'  1 
DC  D'+.001'  2 
 
L-type:
DC  L'525'
DC  L'3.414'  2 

   Enclosed by:

Apostrophes  

   Exponent allowed:

Yes

E-type:
DC  E'1E+60'  3 
 
D-type:
DC  D'-2.5E10'  3 
 
L-type:
DC  L'3.712E-3'  3 

      Rounding mode
      allowed if
      type extension
      specified:

Yes (see Figure 1
for values)

E-type:
DC  EH'1E+60R1'  4 
 
D-type:
DC  DH'-2.5E10R4'  4 
 
L-type:
DC  LH'3.712E-3R5'  4 

      Number of values
      per operand:

 
Multiple

 

  Padding:

Correct fraction is extended
to the right and rounded

 

      Truncation of
      assembled value:

 
Only if rounding mode 5;
rounded otherwise.

 

The format of the constant is shown in Figure 2.

The value of the constant is represented by two parts:

A sign bit (see  3  in Figure 2) indicates whether a positive or negative number has been specified. The number specified must first be converted into a hexadecimal fraction before it can be assembled into the correct internal format. The quantity expressed is the product of the fraction (see  4  in Figure 2) and the number 16 raised to a power (see  5  in Figure 2). Figure 2 shows the external format of the three types of floating-point constants.

Here is the range of values that can be assembled into hexadecimal floating-point constants:

Type of
Constant

Range of Magnitude (M) of Values
(Positive and Negative)

E 16-65 ≤ M ≤ (1-16-6) x 1663
D 16-65 ≤ M ≤ (1-16-14) x 1663
L 16-65 ≤ M ≤ (1-16-28) x 1663
E, D, L 5.4 x 10-79 ≤ M ≤ 7.2 x 1075 (approximate)
If the value specified for a particular constant does not lie within these ranges, the assembled value then depends on these factors:
Figure 2. Hexadecimal floating-point external formats
TypeCalledFormat
─────┼────────────┼────────────────────────────────────────────────────────────────
E    │ Short      │         1  7 bit Characteristic      2  24 bit Fraction
EH   │ Floating-  │  3    + ┌──────────┴──────────┐ ┌────────────┴────────────┐
     │ Point      │  │  ┌───┬─────────────────────┐ ┌───────────/ /───────────┐
     │ Number     │  └> └───┴─────────────────────┘ └───────────/ /───────────┘
     │            │       -
     │            │ Bits 0   1                 7     8                       31
     │            │
     │            │
     │            │
D    │ Long       │          7 bit Characteristic         56 bit Fraction
DH   │ Floating-  │       + ┌──────────┴──────────┐ ┌────────────┴────────────┐
     │ Point      │     ┌───┬─────────────────────┐ ┌───────────/ /───────────┐
     │ Number     │     └───┴─────────────────────┘ └───────────/ /───────────┘
     │            │       -
     │            │ Bits 0   1                 7     8                       63
     │            │
     │            │
     │            │
     │            │                                     High-order 56 bits
L    │ Extended   │          7 bit Characteristic       of 112 bit Fraction
LH   │ Floating-  │       + ┌──────────┴──────────┐ ┌────────────┴────────────┐
LQ   │ Point      │     ┌───┬─────────────────────┐ ┌───────────/ /───────────┐
     │ Number     │     └───┴─────────────────────┘ └───────────/ /───────────┘───┐
     │            │       -                                                       │
     │            │ Bits 0   1                 7     8                       63   │
     │            │                                                               │
     │            │                                 ┌─────────────────────────────┘
     │            │                                 │
     │            │                                 │   Low-order 56 bits
     │            │          7 bit Characteristic   V   of 112 bit Fraction
     │            │       + ┌──────────┴──────────┐ ┌────────────┴────────────┐
     │            │     ┌───┬─────────────────────┐ ┌───────────/ /───────────┐
     │            │     └───┴─────────────────────┘ └───────────/ /───────────┘
     │            │       -           
     │            │ Bits 0   1        │        7     8                       63
     │            │                   │
     │            │            Set in second half
     │            │            of L-type constant


CharacteristicHexadecimal Fraction
──────────────────┼──────────────────────────────────
                  │    4 
                  │    a     b      c
 5     16E        X [ ─── + ───  + ───  + … ]
                  │   16    16²    16³
                  │

where a,b,c ... are hexadecimal digits, and E is an exponent that has a positive or negative value indicated by the characteristic