The R Project SVN R

Rev

Rev 8431 | Rev 37563 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8431 Rev 8895
Line 29... Line 29...
29
{
29
{
30
#ifdef IEEE_754
30
#ifdef IEEE_754
31
    if (ISNAN(x) || ISNAN(lambda))
31
    if (ISNAN(x) || ISNAN(lambda))
32
	return x + lambda;
32
	return x + lambda;
33
#endif
33
#endif
34
    if(lambda < 0.0) ML_ERR_return_NAN;
34
    if(lambda < 0.) ML_ERR_return_NAN;
35
 
35
 
36
    x = floor(x + 1e-7);
36
    x = floor(x + 1e-7);
37
    if (x < 0)
-
 
38
	return R_DT_0;
37
    if (x < 0)		return R_DT_0;
39
 
-
 
40
    if ( lambda == 0.0 )
38
    if (lambda == 0.)	return R_DT_1;
41
	return R_DT_1;
-
 
42
    if (!R_FINITE(x))
39
    if (!R_FINITE(x))	return R_DT_1;
43
	return R_DT_1;
-
 
44
 
40
 
45
    return pgamma(lambda, x + 1, 1., !lower_tail, log_p);
41
    return pgamma(lambda, x + 1, 1., !lower_tail, log_p);
46
}
42
}