[Python-bugs-list] [ python-Bugs-527139 ] random.gammavariate hosed

noreply@sourceforge.net noreply@sourceforge.net
Thu, 07 Mar 2002 12:44:27 -0800


Bugs item #527139, was opened at 2002-03-07 15:44
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=527139&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim Peters (tim_one)
Assigned to: Nobody/Anonymous (nobody)
Summary: random.gammavariate hosed

Initial Comment:
Report from c.l.py; something is certainly wrong here, 
but will take some digging to figure out whether docs 
or code:

"""
From: Weet Vanniks
Sent: Thursday, March 07, 2002 11:14 AM
To: python-list@python.org
Subject: Bug in the standard module random ?


Hi,

The gammavariate function of the standard module is 
documented as taking two parameters, the first one 
alpha is required to be > -1 and the second beta is 
required to be >0.  However, examining the 
implementation, it seems that the requirement for 
alpha is to be >0.

In spite of this, I still have a problem since I 
called the gammavariate function with a parameter 
alpha equal to 0.2 and it fails logically on the 
following line:

ainv=_sqrt(2.0 * alpha - 1.0)

Apparently, the implementation requires alpha to be > 
0.5.  Am i missing something or is it a bug?
"""

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=527139&group_id=5470