Mercurial > hg > octave-thorsten
changeset 6391:3f3e86e9fb57
[project @ 2007-03-07 18:14:44 by jwe]
author | jwe |
---|---|
date | Wed, 07 Mar 2007 18:14:44 +0000 |
parents | 334499d75c5c |
children | e8c42df3d234 |
files | scripts/ChangeLog scripts/specfun/factorial.m scripts/specfun/perms.m |
diffstat | 3 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2007-03-07 Muthiah Annamalai <muthuspost@gmail.com> + + * specfun/perms.m, specfun/factorial.m: Check args. + 2007-03-07 John W. Eaton <jwe@octave.org> * plot/mesh.m: Call newplot before doing anything.
--- a/scripts/specfun/factorial.m +++ b/scripts/specfun/factorial.m @@ -25,7 +25,9 @@ ## @end deftypefn function x = factorial (n) - if (any (n(:) < 0)) + if (nargin != 1) + print_usage (); + elseif (any (n(:) < 0)) error ("factorial: n be be a scalar or array of positive integers"); endif if (isscalar (n))