octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #31772] gamma for negative integers values


From: marco atzeri
Subject: [Octave-bug-tracker] [bug #31772] gamma for negative integers values
Date: Fri, 03 Dec 2010 20:39:11 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0b7) Gecko/20100101 Firefox/4.0b7

URL:
  <http://savannah.gnu.org/bugs/?31772>

                 Summary: gamma for negative integers values
                 Project: GNU Octave
            Submitted by: matzeri
            Submitted on: Fri Dec  3 20:39:10 2010
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

gamma(-1) should be Inf as gamma(0). 
Matlab provides  gamma(-1)=Inf
The same for the other integer negative values.

The test is expecting NaN as on same systems
  tgamma(-n)=NaN
as the NaN value is allowed on
http://www.opengroup.org/onlinepubs/009695399/functions/tgamma.html

The test fails on system were tgamma(-1)=Inf

---------------------------------------------
>>>>> 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
-----------------------------------------------

The attached patch provides
  gamma(-n)=Inf
for all systems and amends test expectation


Reference
http://en.wikipedia.org/wiki/Gamma_function

discussed:
https://www-old.cae.wisc.edu/pipermail/octave-maintainers/2010-October/017501.html

https://www-old.cae.wisc.edu/pipermail/octave-maintainers/2010-November/017796.html






    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri Dec  3 20:39:10 2010  Name: changeset_gamma.patch  Size: 2kB   By:
matzeri

<http://savannah.gnu.org/bugs/download.php?file_id=22120>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31772>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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