March 11, 2009
12:34 p.m.
On Wed, Mar 11, 2009 at 8:26 AM, Sturla Molden <sturla@molden.no> wrote:
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.
import cmath cmath.sqrt(-1) 1j
Greg F