2.8.2 Data Types and Sizes

D provides fundamental data types for integers and floating-point constants. Arithmetic may only be performed on integers in D programs. Floating-point constants may be used to initialize data structures, but floating-point arithmetic is not permitted in D. In Oracle Linux, D provides a 64-bit data model for use in writing programs. However, a 32-bit data model is not supported. The data model used when executing your program is the native data model that is associated with the active operating system kernel, which must also be 64-bit.

The names of the integer types and their sizes in the 64-bit data model are shown in the following table. Integers are always represented in twos-complement form in the native byte-encoding order of your system.

Table 2.3 D Integer Data Types

Type Name

64-bit Size


1 byte


2 bytes


4 bytes


8 bytes

long long

8 bytes

Integer types can be prefixed with the signed or unsigned qualifier. If no sign qualifier is present, it is assumed that the type is signed. The D compiler also provides the type aliases that are listed in the following table.

Table 2.4 D Integer Type Aliases

Type Name



1-byte signed integer


2-byte signed integer


4-byte signed integer


8-byte signed integer


Signed integer of size equal to a pointer


1-byte unsigned integer


2-byte unsigned integer


4-byte unsigned integer


8-byte unsigned integer


Unsigned integer of size equal to a pointer

These type aliases are equivalent to using the name of the corresponding base type listed in the previous table and are appropriately defined for each data model. For example, the uint8_t type name is an alias for the type unsigned char. See Section 2.13, “Type and Constant Definitions” for information about how to define your own type aliases for use in D programs.


The predefined type aliases cannot be used in files that are included by the preprocessor.

D provides floating-point types for compatibility with ANSI C declarations and types. Floating-point operators are not supported in D, but floating-point data objects can be traced and formatted with the printf function. You can use the floating-point types that are listed in the following table.

Table 2.5 D Floating-Point Data Types

Type Name

64-bit Size


4 bytes


8 bytes

long double

16 bytes

D also provides the special type string to represent ASCII strings. Strings are discussed in more detail in Section 2.11, “DTrace Support for Strings”.