Bits |
Values |
Example |
1 |
2 |
Current in a wire. |
2 |
4 |
x86 "ModR/M" byte type field. HW2.3 high bits |
3 |
8 |
One octal digit. x86 register. HW2.3 "funkcode" |
4 |
16 |
One hexadecimal ("hex") digit. Motorola 68000 register. |
5 |
32 |
PowerPC, MIPS, SPARC register number. |
8 |
256 |
One byte. "signed char" (-128 to +127) or "unsigned char" (0 to +255). |
16 |
65,536 |
"short" (-32K to +32K) or "unsigned short" (0 to +64K) |
32 |
4.29 billion |
"int" (-2.14G to +2.14G) or "unsigned int" (0 to +4.29G) |
64 |
18.4 billion-billion |
long long, or on some machines, just "long" |
32-bit x86 (little endian) |
32-bit PowerPC (big endian) |
64-bit x86 or Itanium |
Java / C# |
sizeof(char)==1 |
sizeof(char)==1 |
sizeof(char)==1 |
sizeof(byte)==1 |
char c;(executable NetRun link)
short s;
int i;
long l;
long long ll;
void *v;
float f;
double d;
long double ld;
std::cout<<"sizeof(char)=="<<sizeof(c)<<"\n";
std::cout<<"sizeof(short)=="<<sizeof(s)<<"\n";
std::cout<<"sizeof(int)=="<<sizeof(i)<<"\n";
std::cout<<"sizeof(long)=="<<sizeof(l)<<"\n";
std::cout<<"sizeof(long long)=="<<sizeof(ll)<<"\n";
std::cout<<"sizeof(void *)=="<<sizeof(v)<<"\n";
std::cout<<"sizeof(float)=="<<sizeof(f)<<"\n";
std::cout<<"sizeof(double)=="<<sizeof(d)<<"\n";
std::cout<<"sizeof(long double)=="<<sizeof(ld)<<"\n";
return 0;