Hexadecimal floating-point constants—E, EH, D, DH, L, LH, LQ
- You do not have to consider the fractional portion of a value you specify, nor worry about the position of the decimal point when algebraic operations are to be done.
- You can specify both much larger and much smaller values.
- You retain greater processing precision; that is, your values are carried in more significant figures.
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:
- 1 represents round by adding one in the first lost bit position.
- 4 represents unbiased round to nearest, with tie-breaking rule.
- 5 represents round towards zero (that is, truncate).
- 6 represents round up towards the maximum positive value.
- 7 represents round down towards the minimum negative value.
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.
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) 1 to 8 (byte length) .1 to .64 (bit length) DH-type: .12 to .64 (bit length) 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' 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 Valid rounding mode values 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 1.
A sign bit (see 3 in Figure 1) 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 1) and the number 16 raised to a power (see 5 in Figure 1). Figure 1 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) |
- With type extension H, overflows assemble to the largest magnitude for the specified type, underflows denormalize the value or return zero, depending on the value and rounding mode.
- Without type extension H, certain combinations of exponents (modifier and nominal value) might produce invalid results (message ASMA071E). If the exponent is too large it is ignored, and the nominal value of the constant preceding the exponent is assembled instead.

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