Why historically do people use 255 not 256 for database field magnitudes?

前端 未结 12 749
北荒
北荒 2020-12-07 07:17

You often see database fields set to have a magnitude of 255 characters, what is the traditional / historic reason why? I assume it\'s something to do with paging / memory l

12条回答
  •  青春惊慌失措
    2020-12-07 07:55

    Data is saved in memory in binary system and 0 and 1 are binary digits. Largest binary number that can fit in 1 byte (8-bits) is 11111111 which converts to decimal 255.

提交回复
热议问题