HP Fortran Programmer's Reference (September 2007)

Data types and data objects
Intrinsic data types
Chapter 5116
5HABC
bb
!
bb
= two space characters, making the length equal to 5
Typeless constants
HP Fortran extends the uses of binary, octal, and hexadecimal constants (BOZ) beyond those
prescribed in the Fortran 90 Standard; see “BOZ constants” on page 114. HP Fortran allows
BOZ constants to be used as typeless constants wherever an intrinsic literal constant of any
numeric or logical type is permitted.
If possible, the type attached to a typeless constant is derived from the magnitude of the
constant and the context in which it appears. When used as one operand of a binary operator,
it assumes the type of the other operand. If it is used as the right-hand side of an assignment,
the type of the object on the left-hand side is assumed. When used to define the value within a
structure constructor, it assumes the type of the corresponding component. If appearing in an
array constructor, it assumes the type of the first element of the constructor.
The following rules and restrictions also apply:
If the context does not determine the type, a warning is issued and the type attached to
the constant is:
INTEGER(4) if the constant occupies 1-4 bytes.
INTEGER(8) if the constant occupies more than 4 bytes.
Leading zeros are considered significant in determining the size.
For example, Z'00000001' assumes INTEGER(4), and Z'000000001' assumes
INTEGER(8).
The compiler truncates and issues a warning if more than 8 bytes are required to
represent a constant—for example, Z'12345678123456781234'. The resulting truncated
value differs from that specified in the source code.
When the size of the type determined by context does not match the size of the actual
constant, the constant is either extended with zeroes on the left or truncated from the left
as necessary.
If a single constant is assigned to a complex entity, it is assumed to represent the real part
only and will assume the real type with the same length as the complex entity.
When the compiler attempts to resolve a generic procedure, a BOZ constant in the
argument list is considered to match a logical or numeric dummy argument. An
ambiguous reference is likely to occur. See “Generic procedures” on page 183 for
information about generic procedures.
Except for the intrinsic conversion procedures, a BOZ constant used as an actual
argument for an intrinsic procedure assumes the integer type.