Appendix B. Ranges
Table B-1 and Table B-2 list the ranges of various variable types.
Table B-1. 32-bit Unix machine and Windows-32 systems
Name | Bits | Low value | High value | Accuracy |
---|---|---|---|---|
int | 32 | -2,147,483,648 | 2,147,483,647 | Â |
short int | 16 | -32,768 | 32,767 | Â |
long int | 32 | -2,147,483,648 | 2,147,483,647 | Â |
unsigned int | 32 | 0 | 4,294,967,295 | Â |
unsigned short int | 16 | 0 | 65,535 | Â |
unsigned long int | 32 | 0 | 4,294,967,295 | Â |
char | 8 | System-dependent | Â | Â |
unsigned char | 8 | 0 | 255 | Â |
float | 32 | -3.4E+38 | 3.4E+38 | 6 digits |
double | 64 | -1.7E+308 | 1.7E+308 | 15 digits |
long double | 64 | -1.7E+308 | 1.7E+308 | 15 digits |
Table B-2. Older MS-DOS compilers and most other 16-bit systems
Name | Bits | Low value | High value | Accuracy |
---|---|---|---|---|
int | 16 | -32,768 | 32,767 | Â |
short int | 16 | -32,768 | 32,767 | Â |
long int | 32 | -2,147,483,648 | 2,147,483,647 | Â |
unsigned int | 16 | 0 | 65,535 | Â |
unsigned short int | 16 | 0 | 65,535 | Â |
unsigned long int | 32 | 0 | 4,294,967,295 | Â |
char | 8 | -128 | 127 | Â |
unsigned char | 8 | 0 | 255 | Â |
float | 32 | -3.4E+38 | 3.4E+38 | 6 digits |
double | 64 | -1.7E+308 | 1.7E+308 | 15 digits |
long double | 80 | -3.4E+4932 | 3.4E+4932 | 17 digits |
Get Practical C++ Programming, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.