The R Project SVN R

Rev

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

Rev 68947 Rev 77685
Line 307... Line 307...
307
    double ans, f2, f21, f2lf, ff4, otsum, qsqz, rotsum, t1, twa1, ulen, wprb;
307
    double ans, f2, f21, f2lf, ff4, otsum, qsqz, rotsum, t1, twa1, ulen, wprb;
308
    int i, j, jj;
308
    int i, j, jj;
309
 
309
 
310
#ifdef IEEE_754
310
#ifdef IEEE_754
311
    if (ISNAN(q) || ISNAN(rr) || ISNAN(cc) || ISNAN(df))
311
    if (ISNAN(q) || ISNAN(rr) || ISNAN(cc) || ISNAN(df))
312
	ML_ERR_return_NAN;
312
	ML_WARN_return_NAN;
313
#endif
313
#endif
314
 
314
 
315
    if (q <= 0)
315
    if (q <= 0)
316
	return R_DT_0;
316
	return R_DT_0;
317
 
317
 
318
    /* df must be > 1 */
318
    /* df must be > 1 */
319
    /* there must be at least two values */
319
    /* there must be at least two values */
320
 
320
 
321
    if (df < 2 || rr < 1 || cc < 2) ML_ERR_return_NAN;
321
    if (df < 2 || rr < 1 || cc < 2) ML_WARN_return_NAN;
322
 
322
 
323
    if(!R_FINITE(q))
323
    if(!R_FINITE(q))
324
	return R_DT_1;
324
	return R_DT_1;
325
 
325
 
326
    if (df > dlarg)
326
    if (df > dlarg)
Line 399... Line 399...
399
 
399
 
400
	ans += otsum;
400
	ans += otsum;
401
    }
401
    }
402
 
402
 
403
    if(otsum > eps2) { /* not converged */
403
    if(otsum > eps2) { /* not converged */
404
	ML_ERROR(ME_PRECISION, "ptukey");
404
	ML_WARNING(ME_PRECISION, "ptukey");
405
    }
405
    }
406
    if (ans > 1.)
406
    if (ans > 1.)
407
	ans = 1.;
407
	ans = 1.;
408
    return R_DT_val(ans);
408
    return R_DT_val(ans);
409
}
409
}