print longs
Tim Peters
tim_one at email.msn.com
Tue Oct 5 01:23:28 EDT 1999
[Tim]
> I *hope* Python2 has a generic "number" concept, and doesn't distiguish
> among ints, longs, floats and complexii <ahem> by default.
[David Ascher]
> So you want sqrt(-1) to always succeed? Brr..
Yes -- and it should return 7 <wink>.
sqrt has a right to define its domain. What I would like to see is this not
fail:
>>> math.sqrt(4+0j)
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: can't convert complex to float; use e.g. abs(z)
>>>
sqrt(4) is utterly vanilla, and it's computer-centric nonsense that the
"+0j" somehow makes 4 not 4. This all ties into a principled reason for 1/2
to return 0.5, of course -- or some other internal equivalent that doesn't
suffer silent catastrophic loss of information. These "different rules for
different numbers", like tagging long ints with "L", don't make much sense
to people.
> BTW, it's "complices" (from the French for 'accomplice').
J'aime manger le poulet.
a-sister-made-me-memorize-that-once<wink>-ly y'rs - tim
More information about the Python-list
mailing list