[Python-checkins] CVS: python/nondist/sandbox/datetimedatetime.py,1.28,1.29

Tim Peters tim.one@comcast.net
Mon, 04 Mar 2002 15:09:00 -0500


[MAL]
> Oh, the mxDateTime algorithm is loop-free in a sense as well:
> the correction does at most 3 iterations, the month finder
> at most 12 iterations.

"iterations" sounds like "loops" to me, and so do the "while() {}" blocks in
the code <wink>.

> I'll have a look at yours, though. Perhaps I can make the
> algorithms a bit faster ;-) (oh, I like competition).

Speed here is much more important for us, because we store dates in
broken-down form -- we may need to do ordinal->date on every add and
subtract.  By the time this gets recoded in C, I expect most divmods() will
get converted to floating-point multiplies by provably-good-enough
reciprocal approximations.