Index: trunk/sources/ALGLIB/igammaf.cs
===================================================================
--- trunk/sources/ALGLIB/igammaf.cs	(revision 2445)
+++ trunk/sources/ALGLIB/igammaf.cs	(revision 2563)
@@ -73,16 +73,16 @@
 
             igammaepsilon = 0.000000000000001;
-            if( x<=0 | a<=0 )
+            if( (double)(x)<=(double)(0) | (double)(a)<=(double)(0) )
             {
                 result = 0;
                 return result;
             }
-            if( x>1 & x>a )
+            if( (double)(x)>(double)(1) & (double)(x)>(double)(a) )
             {
                 result = 1-incompletegammac(a, x);
                 return result;
             }
-            ax = a*Math.Log(x)-x-gammaf.lngamma(a, ref tmp);
-            if( ax<-709.78271289338399 )
+            ax = a*Math.Log(x)-x-gammafunc.lngamma(a, ref tmp);
+            if( (double)(ax)<(double)(-709.78271289338399) )
             {
                 result = 0;
@@ -99,5 +99,5 @@
                 ans = ans+c;
             }
-            while( c/ans>igammaepsilon );
+            while( (double)(c/ans)>(double)(igammaepsilon) );
             result = ans*ax/a;
             return result;
@@ -164,16 +164,16 @@
             igammabignumber = 4503599627370496.0;
             igammabignumberinv = 2.22044604925031308085*0.0000000000000001;
-            if( x<=0 | a<=0 )
+            if( (double)(x)<=(double)(0) | (double)(a)<=(double)(0) )
             {
                 result = 1;
                 return result;
             }
-            if( x<1 | x<a )
+            if( (double)(x)<(double)(1) | (double)(x)<(double)(a) )
             {
                 result = 1-incompletegamma(a, x);
                 return result;
             }
-            ax = a*Math.Log(x)-x-gammaf.lngamma(a, ref tmp);
-            if( ax<-709.78271289338399 )
+            ax = a*Math.Log(x)-x-gammafunc.lngamma(a, ref tmp);
+            if( (double)(ax)<(double)(-709.78271289338399) )
             {
                 result = 0;
@@ -197,5 +197,5 @@
                 pk = pkm1*z-pkm2*yc;
                 qk = qkm1*z-qkm2*yc;
-                if( qk!=0 )
+                if( (double)(qk)!=(double)(0) )
                 {
                     r = pk/qk;
@@ -211,5 +211,5 @@
                 qkm2 = qkm1;
                 qkm1 = qk;
-                if( Math.Abs(pk)>igammabignumber )
+                if( (double)(Math.Abs(pk))>(double)(igammabignumber) )
                 {
                     pkm2 = pkm2*igammabignumberinv;
@@ -219,5 +219,5 @@
                 }
             }
-            while( t>igammaepsilon );
+            while( (double)(t)>(double)(igammaepsilon) );
             result = ans*ax;
             return result;
@@ -290,9 +290,9 @@
             y = 1-d-normaldistr.invnormaldistribution(y0)*Math.Sqrt(d);
             x = a*y*y*y;
-            lgm = gammaf.lngamma(a, ref tmp);
+            lgm = gammafunc.lngamma(a, ref tmp);
             i = 0;
             while( i<10 )
             {
-                if( x>x0 | x<x1 )
+                if( (double)(x)>(double)(x0) | (double)(x)<(double)(x1) )
                 {
                     d = 0.0625;
@@ -300,10 +300,10 @@
                 }
                 y = incompletegammac(a, x);
-                if( y<yl | y>yh )
+                if( (double)(y)<(double)(yl) | (double)(y)>(double)(yh) )
                 {
                     d = 0.0625;
                     break;
                 }
-                if( y<y0 )
+                if( (double)(y)<(double)(y0) )
                 {
                     x0 = x;
@@ -316,5 +316,5 @@
                 }
                 d = (a-1)*Math.Log(x)-x-lgm;
-                if( d<-709.78271289338399 )
+                if( (double)(d)<(double)(-709.78271289338399) )
                 {
                     d = 0.0625;
@@ -323,5 +323,5 @@
                 d = -Math.Exp(d);
                 d = (y-y0)/d;
-                if( Math.Abs(d/x)<igammaepsilon )
+                if( (double)(Math.Abs(d/x))<(double)(igammaepsilon) )
                 {
                     result = x;
@@ -331,15 +331,15 @@
                 i = i+1;
             }
-            if( x0==iinvgammabignumber )
-            {
-                if( x<=0 )
+            if( (double)(x0)==(double)(iinvgammabignumber) )
+            {
+                if( (double)(x)<=(double)(0) )
                 {
                     x = 1;
                 }
-                while( x0==iinvgammabignumber )
+                while( (double)(x0)==(double)(iinvgammabignumber) )
                 {
                     x = (1+d)*x;
                     y = incompletegammac(a, x);
-                    if( y<y0 )
+                    if( (double)(y)<(double)(y0) )
                     {
                         x0 = x;
@@ -358,18 +358,18 @@
                 y = incompletegammac(a, x);
                 lgm = (x0-x1)/(x1+x0);
-                if( Math.Abs(lgm)<dithresh )
+                if( (double)(Math.Abs(lgm))<(double)(dithresh) )
                 {
                     break;
                 }
                 lgm = (y-y0)/y0;
-                if( Math.Abs(lgm)<dithresh )
-                {
-                    break;
-                }
-                if( x<=0.0 )
-                {
-                    break;
-                }
-                if( y>=y0 )
+                if( (double)(Math.Abs(lgm))<(double)(dithresh) )
+                {
+                    break;
+                }
+                if( (double)(x)<=(double)(0.0) )
+                {
+                    break;
+                }
+                if( (double)(y)>=(double)(y0) )
                 {
                     x1 = x;
