bernardTr
01-24-2007, 07:38 AM
When I am codding this:
DP NR::gammaln(const DP xx) //Retourne la valeur de ln(gamma(xx)) pour xx>0
{
int j;
DP x,y,tmp,ser;
static const DP cof[6]={76.18009172947146,-86.50532032941677,24.01409824083091,-1.231739572450155,0.1208650973866179e-2,-0.5395239384953e-5};
y=x=xx;
tmp=x+5.5;
tmp -= (x+0.5)*log(tmp);
ser=1.000000000190015;
for (j=0;j<6;j++) ser += cof[j]/++y;
return -tmp+log(2.5066282746310005*ser/x);
}
it says there is a problem:
DP NR::gammaln(DP)' should have been declared inside `NR
what can I do ? thank you
DP NR::gammaln(const DP xx) //Retourne la valeur de ln(gamma(xx)) pour xx>0
{
int j;
DP x,y,tmp,ser;
static const DP cof[6]={76.18009172947146,-86.50532032941677,24.01409824083091,-1.231739572450155,0.1208650973866179e-2,-0.5395239384953e-5};
y=x=xx;
tmp=x+5.5;
tmp -= (x+0.5)*log(tmp);
ser=1.000000000190015;
for (j=0;j<6;j++) ser += cof[j]/++y;
return -tmp+log(2.5066282746310005*ser/x);
}
it says there is a problem:
DP NR::gammaln(DP)' should have been declared inside `NR
what can I do ? thank you