Constants And Internal Representation
Go Up to Constants Overview Index
ANSI C acknowledges that the size and numeric range of the basic data types (and their various permutations) are implementation-specific and usually derive from the architecture of the host computer. For C++Builder, the target platform is the IBM PC family (and compatibles), so the architecture of the Intel Pentium family of microprocessors governs the choices of internal representations for the various data types.
The following table lists the sizes and resulting ranges of the data types.
32-bit data types, sizes, and ranges
Type |
Size (bits) |
Range |
Sample applications |
unsigned char |
8 |
|
Small numbers and full PC character set |
char |
8 |
|
Very small numbers and ASCII characters |
short int |
16 |
|
Counting, small numbers, loop control |
unsigned int |
32 |
|
Large numbers and loops |
int |
32 |
|
Counting, small numbers, loop control |
unsigned long |
32 |
|
Astronomical distances |
enum |
32 |
|
Ordered sets of values |
long |
32 |
|
Large numbers, populations |
float |
32 |
|
Scientific (7-digit precision) |
double |
64 |
|
Scientific (15-digit precision) |
long double |
80 |
|
Financial (18-digit precision) |
Internal Representation Of Numerical Types shows how these types are represented internally in the Intel Pentium family of microprocessors.
See Also
- Constants
- Integer Constants
- Floating Point Constants
- Character Constants
- The Three char Types
- Escape Sequences
- Wide-character And Multi-character Constants
- Unicode Character Types and Literals (C++11)
- String Constants
- Enumeration Constants
- Internal Representation Of Numerical Types
- Constant Expressions
- Extended Integer Types: __int8, __int16, __int32, __int64