[Patches] A bug fix to betavariate() in random.py
Janne Sinkkonen
janne@nnets.fi
31 May 2000 13:56:42 +0300
Guido van Rossum <guido@python.org> writes:
> def beta(a, b):
> x1 = gamma(a)
> if x1 == 0.0: return 0.0
> else: return x1/(x1+gamma(b))
Testing for zero seems to be there to prevent problems in the unlikely
situation that gamma returns zero for both arguments. I was unable to
make random.gammavarite(a,1) return zero, and matlab does not test for
zero, but maybe it's safest to leave the test in.
--
Janne