[gnumeric] TRIMMEAN: Fix p==1 case.



commit ec003c2e07b4af04f226d5164799ca37077f9267
Author: Morten Welinder <terra gnome org>
Date:   Wed Jan 20 14:47:34 2010 -0500

    TRIMMEAN: Fix p==1 case.

 NEWS                        |    2 ++
 plugins/fn-stat/ChangeLog   |    5 +++++
 plugins/fn-stat/functions.c |    4 ++--
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index aaad5fa..a6e3a6d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
 Gnumeric 1.9.19
 
+Morten:
+	* Fix TRIMMEAN border case.  [#607562]
 
 --------------------------------------------------------------------------
 Gnumeric 1.9.18
diff --git a/plugins/fn-stat/ChangeLog b/plugins/fn-stat/ChangeLog
index 29feeb6..124a331 100644
--- a/plugins/fn-stat/ChangeLog
+++ b/plugins/fn-stat/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-20  Morten Welinder  <terra gnome org>
+
+	* functions.c (gnumeric_trimmean): Fix p==1 case.  Return right
+	error value.
+
 2010-01-19  Morten Welinder <terra gnome org>
 
 	* Release 1.9.18
diff --git a/plugins/fn-stat/functions.c b/plugins/fn-stat/functions.c
index 1597722..7bf9203 100644
--- a/plugins/fn-stat/functions.c
+++ b/plugins/fn-stat/functions.c
@@ -298,8 +298,8 @@ gnumeric_trimmean (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 	if (result)
 		goto out;
 
-	if (p < 0 || p > 1) {
-		result = value_new_error_VALUE (ei->pos);
+	if (p < 0 || p >= 1) {
+		result = value_new_error_NUM (ei->pos);
 		goto out;
 	}
 



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