Re: gamma approximation : what is module cmath and where is it located ?

2009-07-30 Thread Dave Angel
pdlem...@earthlink.net wrote: from cmath import * What is cmath, where did it come from and how does it differ from the standard math module ? Dave WB3DWE I saw the number 4 in silver, Guido (apologies to Wm Carlos Wil

Re: gamma approximation : what is module cmath and where is it located ?

2009-07-30 Thread Nobody
On Wed, 29 Jul 2009 23:24:11 -0500, pdlemper wrote: > The following numerical approximation for Euler's Gamma function > is found in http://en.wikipedia.org/wiki/Lanczos_approximation > > from cmath import * > This works in Python 3.0 > > But I can't figure out where it gets "cmath".S

Re: gamma approximation : what is module cmath and where is it located ?

2009-07-30 Thread Chris Rebert
On Thu, Jul 30, 2009 at 3:10 AM, Steven D'Aprano wrote: > On Wed, 29 Jul 2009 21:34:07 -0700, Chris Rebert wrote: > >> The difference is that it handles complex numbers, whereas the plain >> "math" module doesn't. >> I would guess the reason there are separate modules is for performance, >> so as t

Re: gamma approximation : what is module cmath and where is it located ?

2009-07-30 Thread Steven D'Aprano
On Wed, 29 Jul 2009 21:34:07 -0700, Chris Rebert wrote: > The difference is that it handles complex numbers, whereas the plain > "math" module doesn't. > I would guess the reason there are separate modules is for performance, > so as to avoid having to dispatch on type at runtime. But this is only

Re: gamma approximation : what is module cmath and where is it located ?

2009-07-30 Thread Peter Otten
Chris Rebert wrote: > On Wed, Jul 29, 2009 at 11:41 PM, Peter Otten<__pete...@web.de> wrote: >> pdlem...@earthlink.net wrote: >> >>> I've used python a few months and expected to find cmath seperately >>> sort of as a " header file". A text search failed. I now understand >>> its in the Python S

Re: gamma approximation : what is module cmath and where is it located ?

2009-07-29 Thread Chris Rebert
On Wed, Jul 29, 2009 at 11:41 PM, Peter Otten<__pete...@web.de> wrote: > pdlem...@earthlink.net wrote: > >> I've used python a few months and expected to find cmath seperately >> sort of as a " header file".  A text search failed.  I now understand >> its in the Python Standard Library, which I ass

Re: gamma approximation : what is module cmath and where is it located ?

2009-07-29 Thread Peter Otten
pdlem...@earthlink.net wrote: > I've used python a few months and expected to find cmath seperately > sort of as a " header file". A text search failed. I now understand > its in the Python Standard Library, which I assume is that big file > Python30\LIBS\libpython30.a Python 3.1 is no

Re: gamma approximation : what is module cmath and where is it located ?

2009-07-29 Thread Terry Reedy
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 us

Re: gamma approximation : what is module cmath and where is it located ?

2009-07-29 Thread pdlemper
On Wed, 29 Jul 2009 21:36:31 -0700 (PDT), Carl Banks wrote: >On Jul 29, 9:24 pm, pdlem...@earthlink.net wrote: >> What is cmath, where did it come from and how does it differ from >> the standard math module  ? > >What happened when you did a keyword search for "cmath" in the Python >library docu

Re: gamma approximation : what is module cmath and where is it located ?

2009-07-29 Thread Carl Banks
On Jul 29, 9:24 pm, pdlem...@earthlink.net wrote: > What is cmath, where did it come from and how does it differ from > the standard math module  ? What happened when you did a keyword search for "cmath" in the Python library documentation? What happened when you entered "python cmath" in Google?

Re: gamma approximation : what is module cmath and where is it located ?

2009-07-29 Thread Chris Rebert
On Wed, Jul 29, 2009 at 9:24 PM, wrote: > But I can't figure out where it gets "cmath".    Searching the Python > directory reveals no more than a test_cmath.  The only cmath I can find > is a header file in another directory  turboc++\Borland\include\ > > dir(cmath) reveals 23 functions overlapp

gamma approximation : what is module cmath and where is it located ?

2009-07-29 Thread pdlemper
The following numerical approximation for Euler's Gamma function is found in http://en.wikipedia.org/wiki/Lanczos_approximation from cmath import * # Coefficients used by the GNU Scientific Library g = 7 p = [0.80993, 676.5203681218851, -1259.1392167224028, 771.32342877765313, -