News for hackers. Stuff that matters.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by snicker7 on Saturday January 01, 2022 @11:11AM (#29759713)
Time is a number. At least, it makes sense to subtract them (I guess you can say that time is a one dimensional affine space).
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by pjc50 on Saturday January 01, 2022 @11:16AM (#29759773)
Time is a number and a location. If you normalize everything to a reference time such as the UNIX epoch, you can usually do subtraction. Even then you may have got the times from a non-monotonic clock ...
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by bsza on Saturday January 01, 2022 @11:17AM (#29759778)
Time is a number, but a date is not. 211231 + 1 != 211232.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by karpierz on Saturday January 01, 2022 @12:22PM (#29760472)
To be specific, that representation of date does not implement integer addition. To be fair, neither do most "number" types (uint, int, float, etc).

For uint, you actually have x + y = (x + y) mod MAX_UINT.

For float, sometimes x + 1 = x.

The issue is not that date is not a number, but that people poorly reason about common cases of date arithmetic. Similar stuff comes up for floats and ints but they're just easier to reason about.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by gkop on Saturday January 01, 2022 @12:51PM (#29760771)
> For float, sometimes x + 1 = x

Would you spell this out for us?

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by eska on Saturday January 01, 2022 @01:14PM (#29760989)
If x is a huge number, then elimination can happen. Floating point numbers store a mantissa and an exponent, m^e. When you have a huge number the exponent will be large. So the mantissa can not express the tiny number anymore.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by cmeacham98 on Saturday January 01, 2022 @03:42PM (#29762515)
Floats effectively work by specifying a level of precision and a multiplier against that. For big numbers, you need a lower precision (larger gap) between the representable values. Eventually the precision gets so low that adding 1 doesn't reach the next possible value and rounds back down to your current value.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by kaba0 on Saturday January 01, 2022 @11:21AM (#29759826)
Bit of a nitpick, but due to relativity, time is not simply a number though.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by wyldfire on Saturday January 01, 2022 @11:25AM (#29759877)
Relativity is not modeled in the vast, vast majority of computer systems that track time. So the nitpick is irrelevant.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by kaba0 on Saturday January 01, 2022 @11:33AM (#29759963)
But there are rare software that model it (eg. GPS systems famously have to account for it) - so I think it is a textbook definition of a nitpick.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by kzrdude on Saturday January 01, 2022 @11:13AM (#29759743)
just like pointers, it makes sense to subtract them and add offsets but to straight up add them makes no sense.