# HG changeset patch # User Tatsuro MATSUOKA # Date 1280726749 -32400 # Node ID 9a64e02e2aad2a08d39794b8539ed7b987b11367 # Parent 860427ac9b7742ed9edc22b27acae53071bfbcac Validate input arguments for gamma, lgamma. diff -r 860427ac9b77 -r 9a64e02e2aad liboctave/lo-specfun.cc --- a/liboctave/lo-specfun.cc Fri Aug 20 14:55:53 2010 -0700 +++ b/liboctave/lo-specfun.cc Mon Aug 02 14:25:49 2010 +0900 @@ -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));