SPRUI04F july 2015 – april 2023
Table 7-1 lists the size, representation, and range of each scalar data type for the C6000 compiler. Many of the range values are available as standard macros in the header file limits.h.
The storage and alignment of data types is described in Section 8.2.1.
Range | ||||
---|---|---|---|---|
Type | Size | Representation | Minimum | Maximum |
char, signed char | 8 bits | ASCII | -128 | 127 |
unsigned char | 8 bits | ASCII | 0 | 255 |
_Bool, bool | 8 bits | ASCII | 0 (false) | 1 (true) |
short | 16 bits | Binary | -32 768 | 32 767 |
unsigned short, wchar_t (1) | 16 bits | Binary | 0 | 65 535 |
int, signed int | 32 bits | Binary | -2 147 483 648 | 2 147 483 647 |
unsigned int | 32 bits | Binary | 0 | 4 294 967 295 |
long, signed long | 32 bits | Binary | -2 147 483 648 | 2 147 483 648 |
unsigned long | 32 bits | Binary | 0 | 4 294 967 295 |
__int40_t | 40 bits | Binary | -549 755 813 888 | 549 755 813 887 |
unsigned __int40_t | 40 bits | Binary | 0 | 1 099 511 627 775 |
long long, signed long long | 64 bits | Binary | -9 223 372 036 854 775 808 | 9 223 372 036 854 775 807 |
unsigned long long | 64 bits | Binary | 0 | 18 446 744 073 709 551 615 |
enum (2) | varies | Binary | varies | varies |
float | 32 bits | IEEE 32-bit | 1.175 494e-38(3) | 3.40 282 346e+38 |
float complex (4) | 64 bits | Array of 2 IEEE 32-bit | 1.175 494e-38 for real and imaginary portions separately | 3.40 282 346e+38 for real and imaginary portions separately |
double | 64 bits | IEEE 64-bit | 2.22 507 385e-308(3) | 1.79 769 313e+308 |
double complex (4)(5) | 128 bits | Array of 2 IEEE 64-bit | 2.22 507 385e-308 for real and imaginary portions separately | 1.79 769 313e+308 for real and imaginary portions separately |
long double | 64 bits | IEEE 64-bit | 2.22 507 385e-308(3) | 1.79 769 313e+308 |
long double complex (4)(5) | 128 bits | Array of 2 IEEE 64-bit | 2.22 507 385e-308 for real and imaginary portions separately | 1.79 769 313e+308 for real and imaginary portions separately |
pointers, references, pointer to data members | 32 bits | Binary | 0 | 0xFFFFFFFF |
Negative values for signed types are represented using two's complement.
These additional types from C, C99 and C++ are defined as synonyms for standard types:
typedef unsigned int size_t;
typedef int ptrdiff_t;
typedef unsigned int wchar_t;
typedef unsigned int wint_t;
typedef char * va_list;