Mercurial > hg > octave-terminal
changeset 10903:9f0f1a89c704
Add new %!tests for negative integer arguments to gamma, lgamma.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 21 Aug 2010 11:15:44 -0700 |
parents | 9a64e02e2aad |
children | 69a2e9ccb2fb |
files | src/ChangeLog src/mappers.cc |
diffstat | 2 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-08-17 Rik <octave@nomad.inbox5.com> + + * mappers.cc (gamma,lgamma): Add %!tests for negative integer + input arguments. + 2010-08-17 Rik <octave@nomad.inbox5.com> * bitfcns.cc (bitmax): Add additional calling argument, class, and
--- a/src/mappers.cc +++ b/src/mappers.cc @@ -916,6 +916,12 @@ %! v = single([sqrt(pi), 1, .5*sqrt(pi), 1, 2, 6, 24]); %! assert(gamma(x), v, sqrt(eps('single'))) +%!test +%! x = [-1, 0, 1, Inf]; +%! v = [NaN, Inf, 1, Inf]; +%! assert (gamma(x), v); +%! assert (gamma(single (x)), single (v)); + %!error gamma(); %!error gamma(1,2); @@ -1294,6 +1300,12 @@ %! v = single([sqrt(pi), 1, .5*sqrt(pi), 1, 2, 6, 24]); %! assert(lgamma(x), log(v), sqrt(eps ('single'))) +%!test +%! x = [-1, 0, 1, Inf]; +%! v = [Inf, Inf, 0, Inf]; +%! assert (lgamma(x), v); +%! assert (lgamma(single (x)), single(v)); + %!error lgamma(); %!error lgamma(1,2);