[prev] 16 [next]

Binary Constants

Literal numbers in decimal, hexadecimal, octal, binary.

In hexadecimal, each digit represents 4 bits

   0100 1000 1111 1010 1011 1100 1001 0111
0x   4    8    F    A    B    C    9    7

In octal, each digit represents 3 bits

   01 001 000 111 110 101 011 110 010 010 111
0   1  1   0   7   6   5   3   6   2   2   7

In binary, each digit represents 1 bit

0b01001000111110101011110010010111