[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: patch for gamma test
From: |
Marco Atzeri |
Subject: |
Re: patch for gamma test |
Date: |
Wed, 17 Nov 2010 11:27:33 +0000 (GMT) |
--- Mer 17/11/10, Tatsuro MATSUOKA ha scritto:
> Hello
>
>
> Seeing code of the implementation of slatex gamma, in that
> case, gamma(-1)=Inf is condiderd.
>
>
> liboctave/lo-specfun.cc
>
> double
> xgamma (double x)
> {
> #if defined (HAVE_TGAMMA)
> return tgamma (x);
on cywin HAVE_TGAMMA=1
> #else
> double result;
>
> if (xisnan (x))
> result = x;
> else if ((x <= 0 && D_NINT (x) == x) ||
> xisinf (x))
> result = octave_Inf;
> else
> F77_XFCN (xdgamma, XDGAMMA, (x, result));
>
> return result;
> #endif
> }
>
>
> From the part
> else if ((x <= 0 && D_NINT (x) == x) ||
> xisinf (x))
> result = octave_Inf;
>
> it is obvious that implementation of slatec gamma function
> shows gamma(-1)=inf
>
> I think that lo-specfun.cc code or configure check
> should be changed that gamma(minus integer) does
> not depend on the environments.
If the slatec function is correct than only some
external tgamma are wrong.
In any case it is better to report a failure on that platform
and eventually report the failure upstream than
as today where the fail is wrongly reported on the
correct platform.
I doubt it is worth to check gamma(-1) during configuration.
Marco