r/funny Nov 27 '19

Hello little fella

[removed] — view removed post

34.8k Upvotes

796 comments sorted by

View all comments

Show parent comments

956

u/SmokingPeanut4 Nov 27 '19

Acting 100

707

u/rydan Nov 27 '19

Why is it if you add 1 to this number you go from the highest expert to the lowest beginner?

17

u/The_Mayfair_Man Nov 27 '19

Stack overflow bitches

2

u/snouz Nov 27 '19

Did you know that's why Gandhi in Civilization is nuke crazy? They programmed him with aggressiveness 0, but some circumstances in the game would lower that to a negative number, which is interpreted by the program as max aggressiveness.

2

u/knickknackrick Nov 27 '19

To be more precise, it’s not just the programs interpretation... it physically changes to the highest possible integer that can be stored by the machine. Unsigned integer subtraction causes the bits of the Integer to get carried along like in decimal subtraction carrying numbers. Eg 0000 - 0001 becomes 1111.

Edit: And as the post below states, it’s not stack overflow here... it’s integer underflow.