3 ms·
If I may elaborate, the comparison to IEEE floats is apt because they addition is not associative there either: julia> (1e16 + 1) + 1 1.0e16 julia> 1e16 + (1
by gugagore 5y ago
If I may elaborate, the comparison to IEEE floats is apt because they addition is not associative there either:
julia> (1e16 + 1) + 1
1.0e16
julia> 1e16 + (1 + 1)
1.0000000000000002e16
I think the fundamental issue with dates, however, is deeper than "addition is non-associative". It is that "1 month" is a context-sensitive duration (so is a "1 day", due to leap seconds).
I am curious about using intervals. If "{Year} January (no day)" had a representation as "Jan. 1 - Jan. 31", then "Jan. 1 -- Jan. 31" + "1 month" = "{Year} Feb. 1 -- Feb. 28" (or 29 if the {Year} is a leap year".