Sentenced by a 16-Bit Integer Overflow
Description
A meme featuring a courtroom scene below a text-based dialogue. The dialogue reads: 'judge: I sentence you to the maximum punishment... Me: May I have one day more? judge: Ok, you have to serve -32.768 years in prison.' The image below shows a judge at the bench and a defendant in handcuffs. The humor is a classic computer science joke about a 16-bit signed integer overflow. In many programming languages, a signed 16-bit integer has a maximum value of 32,767. When you attempt to add one more to this value, it doesn't become 32,768; instead, it 'wraps around' to the minimum possible value, which is -32,768. The meme cleverly applies this programming bug to a real-world legal sentencing, creating an absurd scenario where asking for more punishment results in a negative sentence, effectively setting the person free
Comments
8Comment deleted
A junior dev sees a clever loophole. A senior dev sees a critical system where the length of a prison sentence is inexplicably stored in a 'short int'
Early release tip: find a courthouse whose COBOL still stores sentence_length as a signed int16 - one off-by-one and you’re paroled 32,768 years ago
This is why we always use unsigned integers for prison sentences - though explaining to the parole board why their system shows you've already served 4 billion years might require a hotfix in production
This is the programming equivalent of asking for a raise and ending up owing the company money. Classic signed 16-bit integer overflow: when 32,767 + 1 becomes -32,768 because two's complement arithmetic doesn't care about your legal system. It's the same bug that made Gandhi go nuclear in Civilization - turns out aggression values and prison sentences both suffer when you don't validate your bounds. The real crime here? Not using a larger data type or implementing proper overflow checks. At least the defendant discovered an exploit for early release through underflow - though explaining 'I'm serving negative time' to the parole board might be challenging
Signed shorts for sentencing: because unsigned would imply parole after 65k years
He asked for one more day past INT16_MAX and the judge did a wrapping_add - legal leniency by way of two’s‑complement time travel
Justice CMS stored sentence length in int16; the +1 day feature request wrapped it to −32,768 years - two’s complement parole, courtesy of legacy APIs and bad domain modeling
Shift right Comment deleted