### 3.1.3.2 COMPLEX(4) Constants

A COMPLEX(4) constant is a pair of integer or single-precision real constants that represent a complex number.

A COMPLEX(4) constant occupies eight bytes of memory and is interpreted as a complex number.

If the real and imaginary part of a complex literal constant are both real, the kind parameter value is that of the part with the greater decimal precision.

The rules for REAL(4) constants apply to REAL(4) constants used in COMPLEX constants. (See Sections 3.1.2.1 and 3.1.2.2 for the rules on forming REAL(4) constants.)

The REAL(4) constants in a COMPLEX constant have one of the following formats:

- On Tru64 UNIX, Linux, WNT, and W9* systems: IEEE S_floating format
- On OpenVMS systems: Compaq VAX F_floating or IEEE S_floating format (depending on the compiler option specified)

Examples

The following examples demonstrate valid and invalid COMPLEX(4) constants:

Valid |
`(1.7039,-1.70391)` |
`(44.36_4,-12.2E16_4)` |
`(+12739E3,0.)` |
`(1,2)` |
Invalid | Explanation
`(1.23,)` | Missing second integer or single-precision real constant.
`(1.0, 2H12)` | Hollerith constant not allowed.

For More Information:

- On general rules for complex constants, see Section 3.1.3.1.
- On the format and range of COMPLEX (COMPLEX(4)) data, see your user manual or programmer's guide.
- On compiler options affecting REAL data, see your user manual or programmer's guide.

Previous Page Next Page Table of Contents