The R Project SVN R

Rev

Rev 69855 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69855 Rev 77685
Line 43... Line 43...
43
 
43
 
44
    /* want to compare dnf(ncp=0) behavior with df() one, hence *NOT* :
44
    /* want to compare dnf(ncp=0) behavior with df() one, hence *NOT* :
45
     * if (ncp == 0)
45
     * if (ncp == 0)
46
     *   return df(x, df1, df2, give_log); */
46
     *   return df(x, df1, df2, give_log); */
47
 
47
 
48
    if (df1 <= 0. || df2 <= 0. || ncp < 0) ML_ERR_return_NAN;
48
    if (df1 <= 0. || df2 <= 0. || ncp < 0) ML_WARN_return_NAN;
49
    if (x < 0.)	 return(R_D__0);
49
    if (x < 0.)	 return(R_D__0);
50
    if (!R_FINITE(ncp)) /* ncp = +Inf -- FIXME?: in some cases, limit exists */
50
    if (!R_FINITE(ncp)) /* ncp = +Inf -- FIXME?: in some cases, limit exists */
51
	ML_ERR_return_NAN;
51
	ML_WARN_return_NAN;
52
 
52
 
53
    /* This is not correct for  df1 == 2, ncp > 0 - and seems unneeded:
53
    /* This is not correct for  df1 == 2, ncp > 0 - and seems unneeded:
54
     *  if (x == 0.) return(df1 > 2 ? R_D__0 : (df1 == 2 ? R_D__1 : ML_POSINF));
54
     *  if (x == 0.) return(df1 > 2 ? R_D__0 : (df1 == 2 ? R_D__1 : ML_POSINF));
55
     */
55
     */
56
    if (!R_FINITE(df1) && !R_FINITE(df2)) { /* both +Inf */
56
    if (!R_FINITE(df1) && !R_FINITE(df2)) { /* both +Inf */