[Python-ideas] math module and complex numbers

Sturla Molden sturla at molden.no
Wed Mar 11 13:26:51 CET 2009


 >>> import math
 >>> math.sqrt(-1)

Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    math.sqrt(-1)
ValueError: math domain error


I'd say math.sqrt(-1) should return 1j.

Sturla Molden





More information about the Python-ideas mailing list