Toppling the numeric tower

Tim Hochberg tim.hochberg at ieee.org
Thu Jul 26 18:57:32 EDT 2001


"Guido van Rossum" <guido at python.org> wrote in message
news:cpzo9r5qty.fsf at cj20424-a.reston1.va.home.com...
> "Tim Hochberg" <tim.hochberg at ieee.org> writes:
 [SNIP]
> >    Real      Complex
> >       |               |
> > rRational cRational -- Rational (Exact)
> > rFloat          cFloat -- Float      (Inexact)
>
> I just don't see much use for complex rational...  So then we're back
> to my original tower (with rational).

Hmmm.... Without complex rationals I suppose you are back to the tower.  I
may be viewing this through a warped lense: once upon a time I reimplemented
NumPy in Java. There it was both much simpler and worked better to do type
conversions based on a box instead of a tower. However, NumPy has many more
types than PEP 228 proposes so it's a lesson that probably doesn't apply
here.

I must admit that complex rationals appeal to me mainly from a aesthetic and
pedagogical point of view. I would probably have about as much use
personally for complex rationals as I do for real rationals; that is, not
very much. But in cases where I'd be tempted to use rationals (for instance
slow, but sure, stability check on a misbehaving algorithm) I'd be about as
likely to be using complex as real numbers. That's probably not typical
though. Thinking about it, fixed precision binary decimal, which is also
appears to be under discussion, would probably be more useful.

Maybe someone who has a more compelling use for complex rationals will come
forward and save my box. Otherwise ... alas poor box, we hardly knew ye.

-tim





More information about the Python-list mailing list