Mercurial > hg > octave-lyh
diff liboctave/lo-specfun.cc @ 10902:9a64e02e2aad
Validate input arguments for gamma, lgamma.
author | Tatsuro MATSUOKA <tmacchant@yahoo.co.jp> |
---|---|
date | Mon, 02 Aug 2010 14:25:49 +0900 |
parents | 4d1fc073fbb7 |
children | ef0e995f8c0f |
line wrap: on
line diff
--- a/liboctave/lo-specfun.cc +++ b/liboctave/lo-specfun.cc @@ -308,7 +308,7 @@ if (xisnan (x)) result = x; - else if (xisinf (x)) + else if ((x <= 0 && D_NINT (x) == x) || xisinf (x)) result = octave_Inf; else F77_XFCN (dlgams, DLGAMS, (x, result, sgngam)); @@ -330,7 +330,7 @@ if (xisnan (x)) result = x; - else if (xisinf (x)) + else if ((x <= 0 && D_NINT (x) == x) || xisinf (x)) result = octave_Inf; else F77_XFCN (dlgams, DLGAMS, (x, result, sgngam)); @@ -373,7 +373,7 @@ if (xisnan (x)) result = x; - else if (xisinf (x)) + else if ((x <= 0 && D_NINT (x) == x) || xisinf (x)) result = octave_Float_Inf; else F77_XFCN (algams, ALGAMS, (x, result, sgngam)); @@ -395,7 +395,7 @@ if (xisnan (x)) result = x; - else if (xisinf (x)) + else if ((x <= 0 && D_NINT (x) == x) || xisinf (x)) result = octave_Float_Inf; else F77_XFCN (algams, ALGAMS, (x, result, sgngam));