[SciPy-User] Question on scipy.special.gammaincc

Skipper Seabold jsseabold at gmail.com
Tue May 24 21:59:29 EDT 2011


On Tue, May 24, 2011 at 7:09 PM, Pauli Virtanen <pav at iki.fi> wrote:
> On Tue, 24 May 2011 15:44:55 -0400, Skipper Seabold wrote:
> [clip]
>> This is because it returns the regularized incomplete gamma function
>> (see the doc string). It returns zero because Gamma(n) = inf for n < 0.
>
> However, 1/Gamma(z) = 0 only at negative integers on the real line, so the
> return value of zero is bogus. The function should really rather return
> `nan` (to indicate that the evaluation is not implemented), or even better,
> compute the correct value.
>

Indeed. For the time being, would a patch to return nan be useful? I
don't see how to correctly raise exceptions from C, unless someone has
a pointer to an example.

Skipper



More information about the SciPy-User mailing list