A programmer was sentenced to 255 days in jail. He asked the judge if he could make it 256 days instead. The judge granted his request and the programmer walked free the next day.
Ok, I'm guessing this has something to do with 256 bits making up a single byte... but I still don't get it. 🤔
@Blort 8 bits make up a single byte.
255 = 0b11111111
Add one and you get 0b100000000.
But if you only have 8 bits, the additional 1 at the front is lost, leaving: 0b00000000, thus turning the 255 day sentence into a 0 day sentence due to an overflow.
Also funny because there's probably at least one court database system in current use where this is true...
Server run by the main developers of the project It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!