pdlem...@earthlink.net wrote:
The following numerical approximation for Euler's Gamma function
is found in http://en.wikipedia.org/wiki/Lanczos_approximation

from cmath import *

But I can't figure out where it gets "cmath".

The Python documentation set has a module index. Really handy. I use it all the time. cmath is under 'c'.

To answer some of your question:

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

Which to use depends on the behavior you want.

tjr

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to