|
|
|
|
|
by Arcuru
1011 days ago
|
|
The clock does wrap around at the top, but the problem comes about when the smallest hand gets to the bottom (the value 0x80). Flipping it would be confusing as that would make the 0x00000000 position be at the bottom. The 2038 problem comes about because of overflow in a 32bit signed int, so the top byte (smallest clock hand in this case) effectively only has 7 bits instead of 8, when it goes above 0x7F is when the int is interpreted as negative. The easiest 'fix', if it's even necessary, would be to make the smallest hand go all the way around in 128 ticks instead of 256. But really this micro blog post could just use an explanation of that to aid the visualization. |
|
I've considered annotating the left side of the dial with the negative numbers also, e.g. ff (-01), etc., which would make it clearer that there's a discontinuity at 80, but it's also a lot of visual mess and on balance I prefer the cleaner look.
I hope that anyone wondering "why 0x80" will be curious enough to go read the linked wikipedia article, which goes into much more detail.