### 8.3.2.4 G Field Descriptor

The G field descriptor transfers real values in a form that, in effect, combines the F and E field descriptors. It takes the following form:

    Gw.d[Ee]

The corresponding I/O list element must have a real data type, or it must be either the real or the imaginary part of a complex data type.

Input Processing

In an input statement, the G field descriptor transfers w characters from the external field and assigns them as a real value to the corresponding I/O list element. The G field descriptor interprets and assigns data in exactly the same way as the F (and E and D) field descriptors (see Section 8.3.2.1).

### Table 8-2 Effect of Data Magnitude on G Format Conversions

Data Magnitude | Effective Conversion
--- | ---
m < 0.1 | Ew.d[Ee]
0.1 <= m < 1.0 | F(w-4).d, n(' ')
1.0 <= m < 10.0 | F(w-4).(d-1), n(' ')
         ...
         ...
10**d-2 <= m < 10**d-1 | F(w-4).1, n(' ')
10**d-1 <= m < 10**d | F(w-4).0, n(' ')
m >= 10**d | Ew.d[Ee]

The n (' ') field descriptor, which is, in effect, inserted by the G field descriptor for values within its range, specifies that four or e+2 spaces are to follow the numeric data representation.

The term w must be large enough to include all of the following:

- A minus sign (when necessary) or a plus sign (if SP editing is in effect)

- A decimal point

- One digit to the left of the decimal point

- The d digits to the right of the decimal point

- Either a 4-character or e+2-character exponent

Therefore, w must be greater than or equal to d+8. If e is present, w must be greater than or equal to d+e+6.

The following list illustrates valid output processing using the G field descriptor (the symbol ^ represents a nonprinting space character):

    Format        Internal Value           External Representation

    G13.6                0.01234567        ^0.123457E-01

    G13.6               -0.12345678        -0.123457^^^^

    G13.6                1.23456789        ^^1.23457^^^^

    G13.6               12.34567890        ^^12.3457^^^^

    G13.6              123.45678901        ^^123.457^^^^

    G13.6            -1234.56789012        ^-1234.57^^^^

    G13.6            12345.67890123        ^^12345.7^^^^

    G13.6           123456.78901234        ^^123457.^^^^

    G13.6         -1234567.89012345        -0.123457E+07

The following list shows the same values output-processed as the previous list, except the following list uses an equivalent F field descriptor(the symbol ^ represents a nonprinting space character):

    Format        Internal Value           External Representation

    F13.6                0.01234567        ^^^^^0.012346

    F13.6               -0.12345678        ^^^^-0.123457

    F13.6                1.23456789        ^^^^^1.234568

    F13.6               12.34567890        ^^^^12.345679

    F13.6              123.45678901        ^^^123.456789

    F13.6            -1234.56789012        ^-1234.567890

    F13.6            12345.67890123        ^12345.678901

    F13.6           123456.78901234        123456.789012

    F13.6         -1234567.89012345        *************

Previous Page Next Page Table of Contents