//EXCEL: GAMMADIST(x,alpha,beta,cumulative)
double x = CommonFns.toNumber(args[0]).doubleValue();
double alpha = CommonFns.toNumber(args[1]).doubleValue();
double beta = CommonFns.toNumber(args[2]).doubleValue();
boolean isCumulative = ((Boolean)args[3]).booleanValue();
DistributionFactory factory = DistributionFactory.newInstance();
if(isCumulative)
return UtilFns.validateNumber(factory.createGammaDistribution(alpha, beta).cumulativeProbability(x));
else
return new Integer(-1); //TODO
}