(Corresponds to Section 4.2 of ANSI X3.9-1978 FORTRAN 77.)
A typeless constant has one of the following forms:
'binary-digits'B
'octal-digits'O
'hexadecimal-digits'Z
'hexadecimal-digits'X
binary-digits, octal-digits, and hexadecimal-digits are nonempty strings of characters in the set 01, 01234567, and 0123456789ABCDEFabcdef, respectively. (The value for A (and a) is 10, for B and b is 11, and so on.)
A prefix-radix constant, such as Z'ABCD', can optionally be treated as typeless. See Options Controlling Fortran Dialect, for information on the -ftypeless-boz option.
Typeless constants have values that depend on the context in which they are used.
All other constants, called typed constants, are interpreted—converted to internal form—according to their inherent type. Thus, context is never a determining factor for the type, and hence the interpretation, of a typed constant. (All constants in the ANSI FORTRAN 77 language are typed constants.)
For example, 1 is always type INTEGER(KIND=1) in GNU
Fortran (called default INTEGER in Fortran 90),
9.435784839284958 is always type REAL(KIND=1) (even if the
additional precision specified is lost, and even when used in a
REAL(KIND=2) context), 1E0 is always type REAL(KIND=2),
and 1D0 is always type REAL(KIND=2).