Technical data
Cray Standard C Extensions [5]
This chapter describes the Cray Standard C extensions to standard C. A program
that uses one or more extensions does not strictly conform to the standard. These
extensions are not available in strict conformance mode.
The following are extensions to the C standard:
• Complex data extensions (Section 5.1, page 105)
• fortran keyword (Section 5.2, page 106)
• Hexadecimal floating-point constants (Section 5.3, page 106)
5.1 Complex Data Extensions
Cray Standard C extends the complex data facilities defined by standard C. The
following are extensions for the complex data facilities:
• Imaginary constants
• Incrementing or decrementing _Complex data
The Cray Standard C compiler supports the Cray imaginary constant extension
and is defined in the <complex.h> header file. This imaginary constant has
the following form:
Ri
R is either a floating constant or an integer constant; no space or other character
can appear between R and i. If you are compiling in strict conformance mode
(-h conform), the Cray imaginary constants are not available.
The following example illustrates imaginary constants:
#include <complex.h>
double complex z1 = 1.2 + 3.4i;
double complex z2 = 5i;
The next extension to the complex data facility allows the prefix— and postfix-
increment and decrement operators to be applied to the _Complex data type.
The operations affect only the real portion of a complex number.
S–2179–36 105










