changeset 14062:5b49cafe0599 stable

Use non-negative, non-positive with hyphens in error messages. * accumarray.m, polyfit.m, factorial.m, nchoosek.m, mcnemar_test.m, find.cc, graphics.cc, sparse.cc: Use non-negative, non-positive with hyphens in error messages for consistency with documentation.
author Rik <octave@nomad.inbox5.com>
date Thu, 15 Dec 2011 22:03:03 -0800
parents 324b2ec6214d
children 6875d23ce051
files scripts/general/accumarray.m scripts/polynomial/polyfit.m scripts/specfun/factorial.m scripts/specfun/nchoosek.m scripts/statistics/tests/mcnemar_test.m src/DLD-FUNCTIONS/find.cc src/graphics.cc src/sparse.cc
diffstat 8 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/general/accumarray.m	Thu Dec 15 21:25:59 2011 -0800
+++ b/scripts/general/accumarray.m	Thu Dec 15 22:03:03 2011 -0800
@@ -264,7 +264,7 @@
       elseif (islogical (vals))
         zero = true;
       elseif (fillval == 0 && all (vals(:) <= 0))
-        ## This is a common case - fillval is zero, all numbers nonpositive.
+        ## This is a common case - fillval is zero, all numbers non-positive.
         zero = 0;
       else
         zero = NaN; # Neutral value.
--- a/scripts/polynomial/polyfit.m	Thu Dec 15 21:25:59 2011 -0800
+++ b/scripts/polynomial/polyfit.m	Thu Dec 15 22:03:03 2011 -0800
@@ -77,7 +77,7 @@
   endif
 
   if (! (isscalar (n) && n >= 0 && ! isinf (n) && n == fix (n)))
-    error ("polyfit: N must be a nonnegative integer");
+    error ("polyfit: N must be a non-negative integer");
   endif
 
   y_is_row_vector = (rows (y) == 1);
--- a/scripts/specfun/factorial.m	Thu Dec 15 21:25:59 2011 -0800
+++ b/scripts/specfun/factorial.m	Thu Dec 15 22:03:03 2011 -0800
@@ -30,7 +30,7 @@
   if (nargin != 1)
     print_usage ();
   elseif (any (n(:) < 0 | n(:) != fix (n(:))))
-    error ("factorial: N must all be nonnegative integers");
+    error ("factorial: N must all be non-negative integers");
   endif
   x = round (gamma (n+1));
 endfunction
@@ -38,5 +38,5 @@
 %!assert (factorial(5), prod(1:5))
 %!assert (factorial([1,2;3,4]), [1,2;6,24])
 %!assert (factorial(70), exp(sum(log(1:70))), -128*eps)
-%!fail ('factorial(5.5)', "must all be nonnegative integers")
-%!fail ('factorial(-3)', "must all be nonnegative integers")
+%!fail ('factorial(5.5)', "must all be non-negative integers")
+%!fail ('factorial(-3)', "must all be non-negative integers")
--- a/scripts/specfun/nchoosek.m	Thu Dec 15 21:25:59 2011 -0800
+++ b/scripts/specfun/nchoosek.m	Thu Dec 15 22:03:03 2011 -0800
@@ -68,7 +68,7 @@
   endif
   if ((isscalar(v) && v < k) || k < 0
       || k != round(k) || any (v < 0 || v != round(v)))
-    error ("nchoosek: args are nonnegative integers with V not less than K");
+    error ("nchoosek: args are non-negative integers with V not less than K");
   endif
 
   n = length (v);
--- a/scripts/statistics/tests/mcnemar_test.m	Thu Dec 15 21:25:59 2011 -0800
+++ b/scripts/statistics/tests/mcnemar_test.m	Thu Dec 15 22:03:03 2011 -0800
@@ -43,7 +43,7 @@
   if (! (min (size (x)) > 1) && issquare (x))
     error ("mcnemar_test: X must be a square matrix of size > 1");
   elseif (! (all (all (x >= 0)) && all (all (x == fix (x)))))
-    error ("mcnemar_test: all entries of X must be nonnegative integers");
+    error ("mcnemar_test: all entries of X must be non-negative integers");
   endif
 
   r = rows (x);
--- a/src/DLD-FUNCTIONS/find.cc	Thu Dec 15 21:25:59 2011 -0800
+++ b/src/DLD-FUNCTIONS/find.cc	Thu Dec 15 22:03:03 2011 -0800
@@ -413,7 +413,7 @@
 
       if (error_state || (val < 0 || (! xisinf (val) && val != xround (val))))
         {
-          error ("find: N must be a nonnegative integer");
+          error ("find: N must be a non-negative integer");
           return retval;
         }
       else if (! xisinf (val))
--- a/src/graphics.cc	Thu Dec 15 21:25:59 2011 -0800
+++ b/src/graphics.cc	Thu Dec 15 22:03:03 2011 -0800
@@ -5682,7 +5682,7 @@
             }
           if ((min_val <= 0 && max_val > 0))
             {
-              warning ("axis: omitting nonpositive data in log plot");
+              warning ("axis: omitting non-positive data in log plot");
               min_val = min_pos;
             }
           // FIXME -- maybe this test should also be relative?
--- a/src/sparse.cc	Thu Dec 15 21:25:59 2011 -0800
+++ b/src/sparse.cc	Thu Dec 15 22:03:03 2011 -0800
@@ -177,7 +177,7 @@
 
 
                if (! error_state && (m < 0 || n < 0))
-                 error ("sparse: dimensions must be nonnegative");
+                 error ("sparse: dimensions must be non-negative");
              }
            else if (nargin != 3)
              print_usage ();