print longs

Charles G Waldman cgw at fnal.gov
Tue Oct 5 04:58:01 EDT 1999


David Ascher writes:
 >
 > So you want sqrt(-1) to always succeed?  Brr..

Why would this be such a terrible thing?  I'm not sure I see the
grounds for your shivering.

If it mattered, one could test the argument for negativity before
calling sqrt, or the result for reality afterwards.  Or wrap these
tests up into a real_sqrt() function...  Or define csqrt() to be the
complex square root and keep sqrt() the way it is (I like this less,
but it's more backward-compatible.  Or maybe just plain "backward").

I'm of the camp that just hates the fact that 1/2 != 1./2. (which
seems to be a holdover from earlier times).  I don't like it when the
behavior of mathematical operations depends on the types of the
arguments.  That's what casts and type-conversions are for, IMO.
 
 > BTW, it's "complices" (from the French for 'accomplice').  

Hmm, I spent 7 years in the Math Dept. at MIT and never once heard
that word.  Indices, matrices and hyperbolae, sure, but never anything
but "the complexes" when referring to that lovely
algebraically-complete number field obtained by adjoining a formal
square root of -1 to the reals.  Maybe if I'd been up the river at
Harvard instead of MIT I would have learned the proper Latin
formation....





More information about the Python-list mailing list