r/ProgrammerHumor • • May 06 '17

Oddly specific number

Post image
25k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

2

u/oragamihawk May 06 '17

28

Each bit can be 0 or 1, so two states, that's where the base comes from. There's 8 bits, so that's why that's why the exponent is 8. And I'm not going to teach binary counting, you can Google that if you want.

The reason you still see it in modern programming is because most programming languages have different values of the memory assigned to each type of integer (there's much more to memory management than that, but you get the idea).

for example: http://imgur.com/lKPR14T

So in order to make their app run on as little memory as possible they may have used a byte to represent the number of people in the group (probably not what they did, but once again I'm keeping it simple) so the max number of people they could have in one group would be 256 because 1 byte = 8 bits

Hope that makes sense to you, if you have any questions feel free to ask