Mercurial > octave-nkf
diff scripts/specfun/factorial.m @ 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 | 984359717d71 |
children | 72c96de7a403 |
line wrap: on
line diff
--- 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")