[gnumeric] PERCENTRANK: Undo last doc fix; fix code instead.



commit f0d867218f222de181cf8cd0bd26cc3400a5c6fd
Author: Morten Welinder <terra gnome org>
Date:   Thu Jan 28 12:11:05 2016 -0500

    PERCENTRANK: Undo last doc fix; fix code instead.

 doc/C/func.defs             |    4 ++--
 doc/C/functions.xml         |    4 ++--
 plugins/fn-stat/functions.c |    8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/doc/C/func.defs b/doc/C/func.defs
index f9d5e59..18d6b88 100644
--- a/doc/C/func.defs
+++ b/doc/C/func.defs
@@ -5160,7 +5160,7 @@ If the data set does not contain any duplicates this function returns a #N/A err
 @ARGUMENTDESCRIPTION= {array}: range of numeric values
 @{x}: data point to be ranked
 @{significance}: number of significant digits, defaults to 3
- NOTE=If @{array} contains no data points, this function returns a #NUM! error. If @{significance} is less 
than zero, this function returns a #NUM! error. If @{x} exceeds the largest value or is less than the 
smallest value in @{array}, this function returns a #NUM! error. If @{x} does not match any of the values in 
@{array} or @{x} matches more than once, this function interpolates the returned value.
+ NOTE=If @{array} contains no data points, this function returns a #NUM! error. If @{significance} is less 
than one, this function returns a #NUM! error. If @{x} exceeds the largest value or is less than the smallest 
value in @{array}, this function returns a #NUM! error. If @{x} does not match any of the values in @{array} 
or @{x} matches more than once, this function interpolates the returned value.
 @SEEALSO=LARGE,MAX,MEDIAN,MIN,PERCENTILE,QUARTILE,SMALL
 
 @CATEGORY=Statistics
@@ -5170,7 +5170,7 @@ If the data set does not contain any duplicates this function returns a #N/A err
 @ARGUMENTDESCRIPTION= {array}: range of numeric values
 @{x}: data point to be ranked
 @{significance}: number of significant digits, defaults to 3
- NOTE=If @{array} contains no data points, this function returns a #NUM! error. If @{significance} is less 
than zero, this function returns a #NUM! error. If @{x} exceeds the largest value or is less than the 
smallest value in @{array}, this function returns a #NUM! error. If @{x} does not match any of the values in 
@{array} or @{x} matches more than once, this function interpolates the returned value.
+ NOTE=If @{array} contains no data points, this function returns a #NUM! error. If @{significance} is less 
than one, this function returns a #NUM! error. If @{x} exceeds the largest value or is less than the smallest 
value in @{array}, this function returns a #NUM! error. If @{x} does not match any of the values in @{array} 
or @{x} matches more than once, this function interpolates the returned value.
 @SEEALSO=LARGE,MAX,MEDIAN,MIN,PERCENTILE,PERCENTILE.EXC,QUARTILE,QUARTILE.EXC,SMALL
 
 @CATEGORY=Statistics
diff --git a/doc/C/functions.xml b/doc/C/functions.xml
index 2d9ad20..45263b2 100644
--- a/doc/C/functions.xml
+++ b/doc/C/functions.xml
@@ -17634,7 +17634,7 @@
       </refsect1>
       <refsect1>
         <title>Note</title>
-        <para>If <parameter>array</parameter> contains no data points, this function returns a #NUM! error. 
If <parameter>significance</parameter> is less than zero, this function returns a #NUM! error. If 
<parameter>x</parameter> exceeds the largest value or is less than the smallest value in 
<parameter>array</parameter>, this function returns a #NUM! error. If <parameter>x</parameter> does not match 
any of the values in <parameter>array</parameter> or <parameter>x</parameter> matches more than once, this 
function interpolates the returned value.</para>
+        <para>If <parameter>array</parameter> contains no data points, this function returns a #NUM! error. 
If <parameter>significance</parameter> is less than one, this function returns a #NUM! error. If 
<parameter>x</parameter> exceeds the largest value or is less than the smallest value in 
<parameter>array</parameter>, this function returns a #NUM! error. If <parameter>x</parameter> does not match 
any of the values in <parameter>array</parameter> or <parameter>x</parameter> matches more than once, this 
function interpolates the returned value.</para>
       </refsect1>
       <refsect1>
         <title>See also</title>
@@ -17673,7 +17673,7 @@
       </refsect1>
       <refsect1>
         <title>Note</title>
-        <para>If <parameter>array</parameter> contains no data points, this function returns a #NUM! error. 
If <parameter>significance</parameter> is less than zero, this function returns a #NUM! error. If 
<parameter>x</parameter> exceeds the largest value or is less than the smallest value in 
<parameter>array</parameter>, this function returns a #NUM! error. If <parameter>x</parameter> does not match 
any of the values in <parameter>array</parameter> or <parameter>x</parameter> matches more than once, this 
function interpolates the returned value.</para>
+        <para>If <parameter>array</parameter> contains no data points, this function returns a #NUM! error. 
If <parameter>significance</parameter> is less than one, this function returns a #NUM! error. If 
<parameter>x</parameter> exceeds the largest value or is less than the smallest value in 
<parameter>array</parameter>, this function returns a #NUM! error. If <parameter>x</parameter> does not match 
any of the values in <parameter>array</parameter> or <parameter>x</parameter> matches more than once, this 
function interpolates the returned value.</para>
       </refsect1>
       <refsect1>
         <title>See also</title>
diff --git a/plugins/fn-stat/functions.c b/plugins/fn-stat/functions.c
index ff366c0..777e385 100644
--- a/plugins/fn-stat/functions.c
+++ b/plugins/fn-stat/functions.c
@@ -2836,7 +2836,7 @@ static GnmFuncHelp const help_percentrank[] = {
        { GNM_FUNC_HELP_ARG, F_("significance:number of significant digits, defaults to 3")},
        { GNM_FUNC_HELP_NOTE, F_("If @{array} contains no data points, this function returns a #NUM! "
                                 "error.") },
-       { GNM_FUNC_HELP_NOTE, F_("If @{significance} is less than zero, this function returns a #NUM! "
+       { GNM_FUNC_HELP_NOTE, F_("If @{significance} is less than one, this function returns a #NUM! "
                                 "error.") },
        { GNM_FUNC_HELP_NOTE, F_("If @{x} exceeds the largest value or is less than the smallest "
                                 "value in @{array}, this function returns a #NUM! error.") },
@@ -2904,7 +2904,7 @@ gnumeric_percentrank (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
                }
 
                /* A strange place to check, but n==1 is special.  */
-               if (significance < 0) {
+               if (significance < 1) {
                        result = value_new_error_NUM (ei->pos);
                        goto done;
                }
@@ -2935,7 +2935,7 @@ static GnmFuncHelp const help_percentrank_exc[] = {
        { GNM_FUNC_HELP_ARG, F_("significance:number of significant digits, defaults to 3")},
        { GNM_FUNC_HELP_NOTE, F_("If @{array} contains no data points, this function returns a #NUM! "
                                 "error.") },
-       { GNM_FUNC_HELP_NOTE, F_("If @{significance} is less than zero, this function returns a #NUM! "
+       { GNM_FUNC_HELP_NOTE, F_("If @{significance} is less than one, this function returns a #NUM! "
                                 "error.") },
        { GNM_FUNC_HELP_NOTE, F_("If @{x} exceeds the largest value or is less than the smallest "
                                 "value in @{array}, this function returns a #NUM! error.") },
@@ -2994,7 +2994,7 @@ gnumeric_percentrank_exc (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
                gnm_float s10;
 
                /* A strange place to check, but n==1 is special.  */
-               if (significance < 0) {
+               if (significance < 1) {
                        result = value_new_error_NUM (ei->pos);
                        goto done;
                }


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