Go to the previous, next section.

CDL Data Types

The CDL data types are:

char
Characters.

byte
Eight-bit data, including zero bytes.

short
16-bit signed integers.

long
32-bit signed integers.

int
(Synonymous with long).

float
IEEE single-precision floating point (32 bits).

real
(Synonymous with float).

double
IEEE double-precision floating point (64 bits).

Except for the added data-type byte and the lack of the type qualifier unsigned, CDL supports the same primitive data types as C. In declarations, type names may be specified in either upper or lower case.

Bytes differ from characters in that they are intended to hold eight bits of data, and the zero byte has no special significance, as it may for character data. Ncgen converts byte declarations to char declarations in the output C code and to the nonstandard BYTE declaration (or similar platform-specific declaration) in output FORTRAN code.

Shorts can hold values between -32768 and 32767. Ncgen converts short declarations to short declarations in the output C code and to the nonstandard INTEGER*2 declaration in output FORTRAN code.

Longs can hold values between -2147483648 and 2147483647. Ncgen converts long declarations to long declarations in the output C code and to INTEGER declarations in output FORTRAN code. In CDL declarations int and integer are accepted as synonyms for long.

Floats can hold values between about -3.4+38 and 3.4+38. Their external representation is as 32-bit IEEE normalized single-precision floating-point numbers. Ncgen converts float declarations to float declarations in the output C code and to REAL declarations in output FORTRAN code. In CDL declarations real is accepted as a synonym for float.

Doubles can hold values between about -1.7+308 and 1.7+308. Their external representation is as 64-bit IEEE standard normalized double-precision, floating-point numbers. Ncgen converts double declarations to double declarations in the output C code and to DOUBLE PRECISION declarations in output FORTRAN code.

Go to the previous, next section.