[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #31776] gamma for negative integers values
From: |
marco atzeri |
Subject: |
[Octave-bug-tracker] [bug #31776] gamma for negative integers values |
Date: |
Fri, 26 Nov 2010 15:10:52 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:2.0b7) Gecko/20100101 Firefox/4.0b7 |
URL:
<http://savannah.gnu.org/bugs/?31776>
Summary: gamma for negative integers values
Project: GNU Octave
Submitted by: matzeri
Submitted on: Fri 26 Nov 2010 03:10:51 PM GMT
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:
>From Mathematical point 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 26 Nov 2010 03:10:51 PM GMT Name: changeset_gamma.patch Size: 2kB
By: matzeri
<http://savannah.gnu.org/bugs/download.php?file_id=22129>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?31776>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #31776] gamma for negative integers values,
marco atzeri <=