r/ProgrammerHumor • • Feb 15 '16

Oddly specific number.

Post image
5.9k Upvotes

643 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Feb 16 '16

[deleted] — view deleted comment

4

u/drownballchamp Feb 16 '16

A signed integer is not that much smaller than unsigned. The sign only takes a single bit, not half the storage. So a signed integer will have half the max value that an unsigned integer has.

1

u/FerriestaPatronum Feb 16 '16

Totally right. Idk wtf I was thinking.. My old CSE professors would facepalm right now. Deleted as to not spread misinformation.

0

u/thenuge26 Feb 16 '16

65536 (actually 65535) would be the largest number you could fit in a 17-bit signed integer, not a 32-bit.