Re: A month of beating a dead horse.
Posted in 1993
->From: aland@informix.com (Colonel Panic) ->Subject: Re: A month of beating a dead horse. ->Date: 22 Apr 93 03:39:41 GMT ->Reply-To: aland@informix.com (Colonel Panic) ->Organization: Enterprise Technologies, Informix Software, Inc. -> ->In article <1qhiolINN2fg@emory.mathcs.emory.edu> alan@effluvia.den.mmc.com (Alan Popiel) writes: ->>It sounds like we are really pretty much in agreement. Remember I said that ->>"[date] + 1 month" was vague, not meaningless. "Feb 30" is (almost) meaning- ->>less; so what we need to do is figure out what "1 month" means as an INTERVAL. ->> ->>My first cut of 31 days may have been too simple. How about: ->> ->>"[date] + 1 month" := "[date] + [number of days in current month], but not ->> past [last day of next month]" ->> ->>Note that this uses Ruchi Patel's "number of days in a month" TWICE! ->> ->>My new formulation gives Feb 3 + 1 month = Mar 3 (always), instead of Mar 6 ->>(or 5); and Jan 29/30/31 + 1 month becomes unambiguously Feb 28 (or 29 in ->>leap years). -> ->Does it bother anybody else that we've changed some basic math rules here, ->e.g. (A - B + B) != A (!!) -> ->>Regards, ->>Alan -> ->P.S.: did anybody get my followups to Cathy's and Alan's response postings? -> They disappeared here, and I never saw them again. My main points were -> that when you mess with math rules to break associativity, there had -> better be a darn good consensus on what is "desirable" behavior. -> ->-- ->Alan Denney aland@informix.com {pyramid|uunet}!infmx!aland Hello, Alan, I do not recall seeing your response. I think I recall hearing about net problems at about that time. Also, the message from me that you quote is a pretty old one. In any event, I also was concerned about the lack of associativity in adding a month to a date. The problem seems to arise from the different, context sensitive, values of how long a month is. Your example of subtracting a month raises yet a new wrinkle that I had not considered: When you subtract a month, do you use [number of days in current month] or [number of days in prior month]? Maybe we need to just live with the fact that this type of math is not associative. After all, physicists have learned to deal with the fact that addition of angular rotations is not commutative, unlike of both scalar and vector quantities. Regards, Alan +------------------------------+---------------------------------------+ | R. Alan Popiel | Internet: alan@den.mmc.com | | Martin Marietta, LSC | ( Please note: My opinions do not ) | | P.O. Box 179, M/S 5422 | ( represent official Martin policy. ) | | Denver, Colorado 80201-0179 | Voice: 303-977-9998 | +------------------------------+---------------------------------------+