octave-maintainers
[Top][All Lists]
Advanced

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

Re: incorrect test on gamma function ?


From: Michael D Godfrey
Subject: Re: incorrect test on gamma function ?
Date: Wed, 27 Oct 2010 12:07:11 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Thunderbird/3.1.4

On 10/27/2010 10:57 AM, Marco Atzeri wrote:
gamma(0) = Inf 
gamma(-1) = NaN 

>>>>> processing /pub/hg/octave/src/mappers.cc
  ***** test
 x = [-1, 0, 1, Inf];
 v = [NaN, Inf, 1, Inf];
 assert (gamma(x), v);
 assert (gamma(single (x)), single (v));
!!!!! test failed
assert (gamma (x),v) expected
   NaN   Inf     1   Inf
but got
   Inf   Inf     1   Inf
NaNs don't match

considering the graphics
http://en.wikipedia.org/wiki/Gamma_function

I presume the two values should be both Inf (or both NaN)

Marco



      

Minor addition: gammaln(0) and gammaln(-1) both return (correctly) Inf.

Michael


reply via email to

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