ok, now that THAT pun is out of the way. Computers allocate space to hold variables, and one of the (older) allocations was "short": 2 bytes or 16 "bits". This gives you 2^16 or a number from 0 to 65536. To get negatives, that first "bit" indicates negative/positive, so that gives you -32768 to +32767.
When computers add beyond that range, there's no semantic assumption about the real value: the next 1 goes where it belongs.
so 011111...111 (32767) + 1 = 100000...0000 which can be either 32768 (unsigned, that first range of 0 to 65536) or -32768 (signed, that second range). The computer chip doesn't care. The software has to decide what it means.
The non-sleeper's "software" decided it meant 65536 sheep jumped back over the fence all at once.
My own pun: we call 16bits a "short" value, with 32 bits a normal and 64 bits a "long".
If a computer is using 16 bits for each number, then the range of numbers is from -32768 to +32767. When it adds 1 to 32767, it starts at the beginning (-32768) again. Like when a clock gets to 12 then starts at 1 again.
no subject
Date: 2009-04-20 03:01 pm (UTC)no subject
Date: 2009-04-20 03:04 pm (UTC)no subject
Date: 2009-04-20 03:12 pm (UTC)no subject
Date: 2009-04-20 03:13 pm (UTC)no subject
Date: 2009-04-20 03:13 pm (UTC)When computers add beyond that range, there's no semantic assumption about the real value: the next 1 goes where it belongs.
so 011111...111 (32767) + 1 = 100000...0000 which can be either 32768 (unsigned, that first range of 0 to 65536) or -32768 (signed, that second range). The computer chip doesn't care. The software has to decide what it means.
The non-sleeper's "software" decided it meant 65536 sheep jumped back over the fence all at once.
My own pun: we call 16bits a "short" value, with 32 bits a normal and 64 bits a "long".
no subject
Date: 2009-04-20 07:56 pm (UTC)i love that comic.
no subject
Date: 2009-04-20 03:17 pm (UTC)no subject
Date: 2009-04-20 03:38 pm (UTC)no subject
Date: 2009-04-20 06:45 pm (UTC)