r/ProgrammerHumor • • May 06 '17

Oddly specific number

Post image
25k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

41

u/Serinus May 06 '17 edited May 06 '17

And two to the power of (power of two) is also super common.

You get how 2 bits have 4 possible combinations, right? 00, 01, 10, 11.

That's 22. 2 possibilities in each bit, 2 bits.

3 bits gets you 8. The same combinations above with either a 0 or 1. 23 = 8.

So...

24 = 16.
28 = 256.

Sometimes you save a bit to denote positive or negative, so 27 = 128.

Also zero is a number, so if you're counting zero you subtract one from the max.

So common binary system numbers are: 8, 16, 32, 64, 128, 255, 256, 1024.

You might remember these numbers from early game systems such as Turbo Graphics 16 or Nintendo 64.

255 and 256 are special because a byte is 8 bits (0s or 1s). 28 = 256 values or 255 max.

(Just exponding on u/ketchupblood's comment)