[gnumeric] BETA: fix special case.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] BETA: fix special case.
- Date: Thu, 19 Mar 2015 12:45:55 +0000 (UTC)
commit cbcee7938eca1a7152e85024048a59e8efcd7dad
Author: Morten Welinder <terra gnome org>
Date: Thu Mar 19 08:44:29 2015 -0400
BETA: fix special case.
Handle removable pole when the arguments sum to a non-negative integer
but neither of them is.
ChangeLog | 5 +++++
NEWS | 1 +
src/sf-gamma.c | 9 +++++++--
3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 92c5331..d8f58b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-19 Morten Welinder <terra gnome org>
+
+ * src/sf-gamma.c (qbetaf): Return zero as result when a+b is a
+ non-positive integer, but neither a nor b is.
+
2015-03-07 Morten Welinder <terra gnome org>
* src/xml-sax-write.c: Use new go_xml_out_add_double.
diff --git a/NEWS b/NEWS
index d49a3e8..b45266e 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ Morten:
* Fix xlsx title export problem.
* Improve test suite.
* Actually implement DECIMAL.
+ * Fix BETA problem with special case.
--------------------------------------------------------------------------
Gnumeric 1.12.21
diff --git a/src/sf-gamma.c b/src/sf-gamma.c
index 87e8dec..aa283d6 100644
--- a/src/sf-gamma.c
+++ b/src/sf-gamma.c
@@ -506,10 +506,15 @@ qbetaf (gnm_float a, gnm_float b, GnmQuad *mant, int *exp2)
if (gnm_isnan (ab) ||
(a <= 0 && a == gnm_floor (a)) ||
- (b <= 0 && b == gnm_floor (b)) ||
- (ab <= 0 && ab == gnm_floor (ab)))
+ (b <= 0 && b == gnm_floor (b)))
return 2;
+ if (ab <= 0 && ab == gnm_floor (ab)) {
+ gnm_quad_init (mant, 0);
+ *exp2 = 0;
+ return 0;
+ }
+
if (!qgammaf (a, &ma, &ea) &&
!qgammaf (b, &mb, &eb) &&
!qgammaf (ab, &mab, &eab)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]