Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Hexadecimal floating-point constants—E, EH, D, DH, L, LH, LQ HLASM Language Reference SC26-4940-06 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
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.
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:
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
Type │ Called │ Format ─────┼────────────┼──────────────────────────────────────────────────────────────── 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 Characteristic │ Hexadecimal 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 |
Copyright IBM Corporation 1990, 2014
|