News for hackers. Stuff that matters.
Re:Good Design is Imperfect Design, Part 1: Honest Names by gugagore on Wednesday August 04, 2021 @04:40PM (#28066027)
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".

There are no comments on this comment yet.