octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for gamma test


From: Tatsuro MATSUOKA
Subject: Re: patch for gamma test
Date: Wed, 17 Nov 2010 08:20:48 +0900 (JST)

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);
#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.


BTW, on MinGW, gamma function is implemented in gcc but slatec gamma function 
has been used.  I do not
the reason why. 


Regards

Tatsuro


--- Ben Abbott wrote:

> 
> On Nov 16, 2010, at 10:35 AM, Marco Atzeri wrote:
> 
> > --- Mar 16/11/10, Ben Abbott  ha scritto:
> > 
> >> Data: Marted将タ 16 novembre 2010, 15:27
> >> On Nov 16, 2010, at 5:03 AM, Marco
> >> Atzeri wrote:
> >> 
> >>> As discussed on
> >>> 
> >>> https://www-old.cae.wisc.edu/pipermail/octave-maintainers/2010-October/017501.html
> >>> 
> >>> this changeset amend the expectation from
> >>> 
> >>>   gamma(-1)= NaN 
> >>> to 
> >>>   gamma(-1)= Inf
> >>> 
> >>> Regards
> >>> Marco
> >>> 
> >>> <gamma.patch>
> >> 
> >> Matlab agrees that gamma(-1) is Inf, not NaN.
> >> 
> >> Octave gives NaN for me.  Should the sources be fixed
> >> to return the proper result?
> >> 
> >> Ben
> >> 
> > 
> > I presume it is system dependent.
> > On cygwin gamma(-1)= Inf
> > 
> > which system are you running ?
> > 
> > Marco
> 
> I'm running MacOS 10.6.5.
> 
> Ben
> 
> 
> 


--------------------------------------
Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/ie8/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]