A C programmer finds a genie lamp.
Posted by CynicalCosmologist@reddit | Jokes | View on Reddit | 16 comments
He rubs it, the genie comes out, and says, "you know the drill. Three wishes."
The programmer says, "make it 0."
The genie says, "OK, you now have 2³²-1 wishes."
LoftyQPR@reddit
For those who don't get it (because it is pretty obscure):
His first wish is to have 0 wishes instead of 3 wishes. When the genie then reduces his number of wishes remaining by one, we get 0 minus 1. Assuming a 32 bit register, a decrement register instruction would change the value from all 0s to all 1s: which represents "2^32 - 1". I guess the joke is in the sighn (misspelling intentional).
speculatrix@reddit
You young'uns with your 32 bit registers. Back in my day we had 8 bits, and were glad for every bit!
InitHello@reddit
Luxury. Back in my day we owed the stack 4 bits.
Gandgareth@reddit
O' course, when i say 8 bit register, it was really just a few gold traces covered with a sheet of ceramic insulator.
EeeGee@reddit
You 'ad gold? Cor, to be so lucky! When I were a lad we 'ad nowt but a bit of tinfoil out of a cig packet and we 'ad to beg for brick scraps off t'builders to use as insulators!
RecalcitrantHuman@reddit
You were lucky.
ondulation@reddit
You posh people! When I grew up we had to manually move rocks in the CPU and they were covered in slime.
Stekor-Tidder@reddit
Rocks and slime! Oh, we used to dream of rocks and slime. The best we could manage to get was mud -- and we had to push it around with shovels made from rolled-up newspapers.
Recent_Practice6539@reddit
serious question, shouldn’t it be 233 -1 ?
mkawick@reddit
I could see an argument for 255 or possibly 65535
233-1? No idea
LoftyQPR@reddit
I suddenly got it. I think he means 2^33 - 1. Which would be correct with a 33 bit register!
NewGuy-1964@reddit
Except that there were no 33 bit registers. At least not in any standardized form. We went from four, to eight, to 16, to 32, to 64.
LoftyQPR@reddit
Right. Probably just a math error. "Off by one" errors in computing are common!
NewGuy-1964@reddit
A 32-bit register is numbered 0 through 31, so you actually have an off by two error.
mkawick@reddit
Find computer science there's another thing as an off-by-one error /s
LoftyQPR@reddit
No. But I'd be interested in hearing how you got that.