|
|
|
|
|
by zahlman
606 days ago
|
|
it isn't necessary in Python, either. GP is only importing it for square roots, but exponentiation (via the ** operator) by .5 works fine with complex numbers in Python as well. It even handles complex exponents (although you'd have to look up the branch cut semantics etc. in the documentation): >>> (1+1j)**(1+1j)
(0.2739572538301211+0.5837007587586147j)
Ironically, the `math` library doesn't handle that: >>> math.pow(1+1j, 1+1j)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: must be real number, not complex
|
|