octave-maintainers
[Top][All Lists]
Advanced

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

incorrect test on gamma function ?


From: Marco Atzeri
Subject: incorrect test on gamma function ?
Date: Wed, 27 Oct 2010 18:57:48 +0100 (BST)

Hi,
could someone explain me why
we expect:

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



      



reply via email to

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