The R Project SVN R

Rev

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

Rev 59170 Rev 60268
Line 59... Line 59...
59
 * without actually calling phyper.  This assumes that
59
 * without actually calling phyper.  This assumes that
60
 *
60
 *
61
 *     x * (NR + NB) <= n * NR
61
 *     x * (NR + NB) <= n * NR
62
 *
62
 *
63
 */
63
 */
64
    long double sum = 0;
64
    LDOUBLE sum = 0;
65
    long double term = 1;
65
    LDOUBLE term = 1;
66
 
66
 
67
    while (x > 0 && term >= DBL_EPSILON * sum) {
67
    while (x > 0 && term >= DBL_EPSILON * sum) {
68
	term *= x * (NB - n + x) / (n + 1 - x) / (NR + 1 - x);
68
	term *= x * (NB - n + x) / (n + 1 - x) / (NR + 1 - x);
69
	sum += term;
69
	sum += term;
70
	x--;
70
	x--;