Bit-by-bit

  • a byte is specifically a sequence of 8 bits
  • 1 byte can represent 2^8 = 256 different symbols

  • with an unsigned datatype, all of the bits are used to represent magnitude of the number.

    smallest: 00000000 00000000 00000000 00000000
    largest: 11111111 11111111 11111111 11111111
    
  • In a signed datatype, one bit is reserved to represent the sign of the number (typically, 0 = positive and 1 = negative), and the remaining bits represent the magnitude of the number.

    smallest: -2 ^ 31
    largest: 2 ^ 31 - 1
    
REFERENCE: Stepik 1.6

results matching ""

    No results matching ""