3 ms·
That (some date + 1 month) + 1 month ≠ some date + 2 months has always been true for floating numbers. This is exactly why you never trust fast matrix mul
by ThinBold 5y ago
That
(some date + 1 month) + 1 month ≠ some date + 2 months
has always been true for floating numbers.
This is exactly why you never trust
fast matrix multiplications---they rely on cancelations
of the form (a + b) - b = a + (b - b) = a.
I would argue that 1 month
is just having too few significant digits.
You can even implement it as
returning 30 with probability 60% and
returning 31 with probability 40%.
Then on average you would have
1 year ≈ sum([1 month] * 12)
- sib 5y agoSure, but I'd guess that neither developers nor "normal people" immediately think "floating point" when they think about a month.