Title text:
It has been −2,147,483,648 days since our last integer overflow.
Transcript:
Transcript will show once it’s been added to explainxkcd.com
Source: https://xkcd.com/3228/
Title text:
It has been −2,147,483,648 days since our last integer overflow.
Transcript:
Transcript will show once it’s been added to explainxkcd.com
Source: https://xkcd.com/3228/
why is it a negative number for the floating point error one? Doesn’t a day counter either increments or be set to zero? are they minusing the day by the value it holds to make it zero instead of just assigning it zero?? Why??
At a guess, the counter goes up by fractions of a day internally, but it’s reset by subtracting the integer part, rounded.
The original version wouldn’t have had the rounding but they “fixed” that after the first time they did a reset and it went to 1 not 0.
As to why they wouldn’t just set it to zero, well here we have the joke under a microscope and it’s struggling to stay alive. Put the scalpel down.
… they were just about to experience a floating point error when the sign was put up.
They’re using a signed 32-bit integer which can overflow to negative numbers. An unsigned integer would roll over to just 0, but then the joke wouldn’t work.
Edit: I misread the question and was thinking about the title text