power TypeErrors

Michael Hudson mwh at python.net
Thu Nov 7 06:12:07 EST 2002


Tim Peters <tim.one at comcast.net> writes:

> [Michael Hudson]
> > ...
> > It's a bit odd that there's no cmath.pow().
> 
> But not surprising:  a good-quality pow() is difficult to code even for
> reals, and numerical analysts had nothing to do with Python's cmath.

Well, that's waht I thought: I know a good cmath.pow() is hard, but
I'm still faintly surprised cmath doesn't have a bad one :)

> If "most" vendors bother to implement C99 (I'm afraid that's not a
> certainty), Python can borrow its cpow() to plug this hole.  Short
> of that, exp(y*log(x)) makes users responsible for their own numeric
> screwups.

For all my mathematical leanings, I still don't really see the point
of having complex numbers native to a language.  The only other
language that springs to mind with them is CL, and I don't think
anyone uses them there, either.  OTOH, I guess it's an "if you need
it, you need it" thing -- I could probably cope if Python didn't have
floats :)

integers-strings-and-instances-will-do-me-ly y'rs
M.

-- 
  Counting lines is probably a good idea if you want to print it out
  and are short on paper, but I fail to see the purpose otherwise.
                                        -- Erik Naggum, comp.lang.lisp



More information about the Python-list mailing list