[SciPy-dev] Definition of gammaln(x) for negative x

David Cournapeau cournape@gmail....
Mon Nov 3 03:03:07 CST 2008


>
> It might make sense to keep gammaln as it is, but to optionally return
> the sign information of gamma(A) in some way.

I don't know what's best. You're right that gammaln is often useful to
control precision of gamma which quickly overflows in the linear
domain, and it is documented as such (I should have looked at the
docstring). OTOH, having a function which actually computes the log
gamma would be useful, too. Changing the current gammaln to get the
sign information is not easy either; we could add an argument sign to
the function, in which case the function would return two values (the
value + the sign), but I don't like it (I don't like having function
returning different values depending on the argument).

cheers,

David


More information about the Scipy-dev mailing list