News for hackers. Stuff that matters.
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.